Re: Serializable Snapshot Isolation

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Heikki Linnakangas" <heikki(dot)linnakangas(at)enterprisedb(dot)com>, "Kevin Grittner" <grimkg(at)gmail(dot)com>
Cc: <drkp(at)csail(dot)mit(dot)edu>,<pgsql-hackers(at)postgresql(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Serializable Snapshot Isolation
Date: 2010-09-22 18:42:34
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I wrote:
> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)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.


Attachment Content-Type Size
serializable-6.patch text/plain 195.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2010-09-22 18:49:50 Re: Configuring synchronous replication
Previous Message Tom Lane 2010-09-22 18:38:10 Re: .gitignore files, take two