Re: and waiting - Mailing list pgsql-hackers

From Gurjeet Singh
Subject Re: and waiting
Date
Msg-id 65937bea0802021513m9f45e5bufb4a8fce0730421a@mail.gmail.com
Whole thread Raw
In response to Re: and waiting  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: and waiting  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
On Feb 2, 2008 2:28 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
I wrote:
> "Gurjeet Singh" <singh.gurjeet@gmail.com> writes:
>> I saw a strange behaviour on one of the production boxes. The
>> pg_stat_activity shows a process as <IDLE> and yet 'waiting' !!! On top of
>> it (understandably, since its IDLE), there are no entries for this pid in
>> pg_locks!

> Hmm, I can reproduce something like this by aborting a wait for lock.
> It seems the problem is that WaitOnLock() is ignoring its own good
> advice, assuming that it can do cleanup work after waiting.

I've committed a fix for this.  (Too late for 8.3.0, unfortunately.)

Thanks. Like 8.2, can it not be back-patched on 8.3 too?

I just looked at the patch... Isn't PG_TRY() an expensive call to make in the lock.c code? I was thinking of registering a Xact callback using RegisterXactCallback() and performing 'waiting' reset in that callback if the Xact event is XACT_EVENT_ABORT.

That would have been compliant with the previous comments ('if we fail, any cleanup must happen in xact abort processing, not here').

Comments.

Best regards,
--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com

EnterpriseDB      http://www.enterprisedb.com

17° 29' 34.37"N,   78° 30' 59.76"E - Hyderabad
18° 32' 57.25"N,   73° 56' 25.42"E - Pune
37° 47' 19.72"N, 122° 24' 1.69" W - San Francisco *

http://gurjeet.frihost.net

Mail sent from my BlackLaptop device

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Truncate Triggers
Next
From: Alvaro Herrera
Date:
Subject: Re: and waiting