Re: SSI patch version 12

Поиск
Список
Период
Сортировка
От Dan Ports
Тема Re: SSI patch version 12
Дата
Msg-id 20110117212606.GG87714@csail.mit.edu
обсуждение исходный текст
Ответ на Re: SSI patch version 12  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список 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 по дате отправления:

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: WIP: RangeTypes
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Warning compiling pg_dump (MinGW, Windows XP)