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

From Tom Lane
Subject Re: bug in fast-path locking
Date
Msg-id 10311.1333993786@sss.pgh.pa.us
Whole thread Raw
In response to Re: bug in fast-path locking  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: bug in fast-path locking  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> 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.

Haven't looked at the code, but maybe it'd be better to not bump the
strong lock count in the first place until the final step of updating
the lock tables?
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Greg Sabino Mullane"
Date:
Subject: Re: Revisiting extract(epoch from timestamp)
Next
From: Tom Lane
Date:
Subject: Re: Revisiting extract(epoch from timestamp)