Re: Serializable Snapshot Isolation
Kevin Grittner <kevin.grittner@wicourts.gov>
From: "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
To: "Heikki Linnakangas" <heikki.linnakangas@enterprisedb.com>, "Kevin Grittner" <grimkg@gmail.com>
Cc: <drkp@csail.mit.edu>,<pgsql-hackers@postgresql.org>, "Tom Lane" <tgl@sss.pgh.pa.us>
Date: 2010-09-22T18:42:34Z
Lists: pgsql-hackers
Attachments
- serializable-6.patch (text/plain) patch
I wrote: > Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote: > >> ISTM you never search the SerializableXactHash table using a hash >> key, except the one call in CheckForSerializableConflictOut, but >> there you already have a pointer to the SERIALIZABLEXACT struct. >> You only re-find it to make sure it hasn't gone away while you >> trade the shared lock for an exclusive one. If we find another >> way to ensure that, ISTM we don't need SerializableXactHash at >> all. >> it seems like it could be made simpler somehow.. > > After tossing it around in my head for a bit, the only thing that > I see (so far) which might work is to maintain a *list* of > SERIALIZABLEXACT objects in memory rather than a using a hash > table. The recheck after releasing the shared lock and acquiring > an exclusive lock would then go through SerializableXidHash. After discussion on a separate thread, I replaced that hash table with a home-grown shared memory list. I had to create a patch at that point due to the git migration, so I figured I might as well post it, too. There have been some non-trivial changes due to feedback on the prior posting. -Kevin