Re: Re: [COMMITTERS] pgsql: Add some isolation tests for deadlock detection and resolution. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: [COMMITTERS] pgsql: Add some isolation tests for deadlock detection and resolution.
Date
Msg-id 25756.1455327615@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: [COMMITTERS] pgsql: Add some isolation tests for deadlock detection and resolution.  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Feb 12, 2016 at 6:22 PM, Andres Freund <andres@anarazel.de> wrote:
>> I wonder if we shouldn't just expose a 'which pid is process X waiting
>> for' API, implemented serverside. That's generally really useful, and
>> looks like it's actually going to be less complicated than that
>> query... And it's surely going to be faster.

> If PID 12000 and PID 13000 hold AccessShareLock on relation foo, and
> PID 14000 awaits AccessExclusiveLock on that relation, what does the
> function return when 14000 is passed as an argument?

Yeah.  In general, it's not that easy to say that A is waiting
specifically on B --- there may be multiple blockers and/or multiple ways
it could get released.  isolationtester's query is not really correct
IMO.  It's okay as long as nothing else besides autovacuum is taking
locks, but I wouldn't want to try to make it work in a general purpose
environment.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Christian Ullrich
Date:
Subject: Re: Crash with old Windows on new CPU
Next
From: Tom Lane
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Add some isolation tests for deadlock detection and resolution.