Re: SSI patch version 12 - Mailing list pgsql-hackers

From Dan Ports
Subject Re: SSI patch version 12
Date
Msg-id 20110117212606.GG87714@csail.mit.edu
Whole thread Raw
In response to Re: SSI patch version 12  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On Mon, Jan 17, 2011 at 09:58:44PM +0200, Heikki Linnakangas wrote:
> What does that comment about list of concurrent r/w transactions refer 
> to? I don't see any list there. Does it refer to 
> possibleUnsafeConflicts, which is above that comment?

Yes, that comment was supposed to be attached to
possibleUnsafeConflicts. It appears to have wandered down a couple
lines, maybe during some combination of git merges and pgindent runs.

> Above SERIALIZABLEXID struct:
> >  * A hash table of these objects is maintained in shared memory to provide a
> >  * quick way to find the top level transaction information for a serializable
> >  * transaction,  Because a serializable transaction can acquire a snapshot
> >  * and read information which requires a predicate lock before it has a
> >  * TransactionId, it must be keyed by VirtualTransactionId; this hashmap
> >  * allows a fast link from MVCC transaction IDs to the related serializable
> >  * transaction hash table entry.
> 
> I believe the comment is trying to say that there's some *other* hash 
> that is keyed by VirtualTransactionId, so we need this other one keyed 
> by TransactionId. It took me a while to understand that, it should be 
> rephrased.

Actually, I think that "other" hash no longer exists, it got replaced
with a list because we weren't actually using vxid -> sxact lookup. So
the comment appears to be both confusing and inaccurate and should be
removed entirely, other than to note somewhere that not every
SERIALIZABLEXACT will appear in SerializableXidHash because it might
not have a TransactionId. 

The comment above SERIALIZABLEXACT also needs to be updated since it
refers to said hash table. And if I'm not mistaken (Kevin?), we can
eliminate SERIALIZABLEXACTTAG altogether and not bother putting the
vxid in the sxact.

While we're at it, it probably wouldn't hurt to rename
SerializableXactHashLock to PredTranLock or something, since there's no
SerializableXactHash anymore (although the lock is still being used
correctly)

Dan

-- 
Dan R. K. Ports              MIT CSAIL                http://drkp.net/


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: WIP: RangeTypes
Next
From: Andrew Dunstan
Date:
Subject: Re: Warning compiling pg_dump (MinGW, Windows XP)