Re: SSI patch version 12

From: Dan Ports <drkp(at)csail(dot)mit(dot)edu>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: SSI patch version 12
Date: 2011-01-17 21:26:06
Message-ID: 20110117212606.GG87714@csail.mit.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2011-01-17 21:37:56 Re: Warning compiling pg_dump (MinGW, Windows XP)
Previous Message David Fetter 2011-01-17 21:23:31 Re: WIP: RangeTypes