Re: Let's invent a function to report lock-wait-blocking PIDs

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Let's invent a function to report lock-wait-blocking PIDs
Date: 2013-03-20 18:37:12
Message-ID: 20130320183712.GE3688@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas escribió:
> On Wed, Mar 20, 2013 at 2:02 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > I was just looking into why the -DCLOBBER_CACHE_ALWAYS buildfarm
> > critters aren't managing to run the new "timeouts" isolation test
> > successfully, despite very generous timeouts. The answer is that
> > 2 seconds isn't quite enough time to parse+plan+execute the query
> > that isolationtester uses to see if the current test session is
> > blocked on a lock, if CLOBBER_CACHE_ALWAYS is on. Now, that query
> > is totally horrible:

> > In the isolationtester use-case, we'd get the right answer by testing
> > whether this function's result has any overlap with the set of PIDs of
> > test sessions, ie
> >
> > select pg_blocking_pids($1) && array[pid1, pid2, pid3, ...]
>
> Sounds excellent.

Yeah, I have looked at that query a couple of times wondering how it
could be improved and came up blank. Glad you had a reason to be in the
area.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-03-20 18:51:09 Re: machine-parseable object descriptions
Previous Message Alvaro Herrera 2013-03-20 18:34:21 Re: machine-parseable object descriptions