Re: Serializable Snapshot Isolation - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Serializable Snapshot Isolation
Date
Msg-id 4C9A07CA0200002500035B4C@gw.wicourts.gov
Whole thread Raw
In response to Re: Serializable Snapshot Isolation  (Kevin Grittner <grimkg@gmail.com>)
List pgsql-hackers
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


Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: .gitignore files, take two
Next
From: Dimitri Fontaine
Date:
Subject: Re: Configuring synchronous replication