Re: lock on object is already held - Mailing list pgsql-hackers

From Tom Lane
Subject Re: lock on object is already held
Date
Msg-id 18886.1385573437@sss.pgh.pa.us
Whole thread Raw
In response to Re: lock on object is already held  (Daniel Wood <dwood@salesforce.com>)
Responses Re: lock on object is already held
List pgsql-hackers
Daniel Wood <dwood@salesforce.com> writes:
> Does the original version of my stress test not repro the problem on 9.2?

[ tries it ... ]  No, it doesn't, or at least the MTBF is a couple orders
of magnitude better than on 9.3.

Another odd thing (seen with my short version as well as your original)
is that 9.3/HEAD run the test case enormously faster than 9.2 and 9.1
do.  The older versions seem to spend a lot of time sleeping, which
I don't understand.

> Why does LockAcquireExtended() test for "nLocks == 0" in the "if
> (dontWait)" block before calling RemoveLocalLock()?

Looks like a useless test to me --- we wouldn't be here at all if nLocks
had been positive to start with, and there's nothing in between that
could raise the count.  On the other hand, removing a LOCALLOCK that
did have positive count would be disastrous.  Maybe what would be
more appropriate is an Assert(nLocks == 0) in RemoveLocalLock().
        regards, tom lane



pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: Status of FDW pushdowns
Next
From: Dimitri Fontaine
Date:
Subject: Re: Extension Templates S03E11