Re: bug in fast-path locking - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: bug in fast-path locking
Date
Msg-id 4F8365BE.3080506@nasby.net
Whole thread Raw
In response to Re: bug in fast-path locking  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: bug in fast-path locking  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
On 4/9/12 12:32 PM, Robert Haas wrote:
> I looked at this more.  The above analysis is basically correct, but
> the problem goes a bit beyond an error in LockWaitCancel().  We could
> also crap out with an error before getting as far as LockWaitCancel()
> and have the same problem.  I think that a correct statement of the
> problem is this: from the time we bump the strong lock count, up until
> the time we're done acquiring the lock (or give up on acquiring it),
> we need to have an error-cleanup hook in place that will unbump the
> strong lock count if we error out.   Once we're done updating the
> shared and local lock tables, the special handling ceases to be
> needed, because any subsequent lock release will go through
> LockRelease() or LockReleaseAll(), which will do the appropriate
> clenaup.
>
> The attached patch is an attempt at implementing that; any reviews appreciated.

Dumb question... should operations in the various StrongLock functions take place in a critical section? Or is that
alreadyensure outside of these functions?
 
-- 
Jim C. Nasby, Database Architect                   jim@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net


pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Last gasp
Next
From: Jeff Davis
Date:
Subject: Re: bug in fast-path locking