Re: lazy vxid locks, v3 - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: lazy vxid locks, v3
Date
Msg-id 1312158741.29391.75.camel@jdavis
Whole thread Raw
In response to lazy vxid locks, v3  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: lazy vxid locks, v3
List pgsql-hackers
On Wed, 2011-07-20 at 13:41 -0400, Robert Haas wrote:
> I took another look at v2 of my lazy vxid locks patch and realized
> that it was pretty flaky in a couple of different ways.  Here's a
> version that I think is a bit more robust, but considering the extent
> of the revisions, it probably needs another round of review from
> someone before I commit it.
> 
> Any review appreciated; I would prefer not to have to wait until
> October to get this committed, since there is quite a bit of follow-on
> work that I would like to do as well.  FWIW, the performance
> characteristics are basically identical to the previous versions,
> AFAICT.
> 

fpLocalTransactionId is redundant with the lxid, and the explanation is
that one that they have different locking semantics. That looks
reasonable, and it avoided the need for the careful ordering while
starting/ending a transaction that was present in v2.

However, it also looks like you're using it for another purpose:

In VirtualXactLockTableCleanup():
/** If fpVXIDLock has been cleared without touching fpLocalTransactionId,* that means someone transferred the lock to
themain lock table.*/
 
if (!fastpath && LocalTransactionIdIsValid(lxid))

Is the "&& LocalTransactionIdIsValid(lxid)" a guard against calling
VirtualXactLockTableCleanup twice? Can that happen? Or is it just
defensive coding to avoid making an additional assumption?

Regards,Jeff Davis

PS: In the recent sinval synch patch, you had a typo: "If we haven't
catch up completely". Other than that, it looked good.



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: python cleanup
Next
From: Jeff Davis
Date:
Subject: Re: SSI heap_insert and page-level predicate locks