Re: Signaling of waiting for a cleanup lock?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Signaling of waiting for a cleanup lock?
Date: 2014-04-14 15:30:02
Message-ID: 25688.1397489402@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> On 2014-04-14 15:45:45 +0100, Simon Riggs wrote:
>> On 13 April 2014 16:44, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
>>> What I am not sure about is how... It's trivial to set
>>> pg_stat_activity.waiting = true, but without a corresponding description
>>> what the backend is waiting for it's not exactly obvious what's
>>> happening. I think that's better than nothing, but maybe somebody has a
>>> glorious better idea.

>> pg_stat_activity.waiting = true

> Yes. That's what I suggested above. The patch for it is trivial, but:
> Currently - I think - everything that sets waiting = true, also has
> contents in pg_locks. Not sure if it will confuse users if that's not
> the case anymore.

I think it will. This is a case where a quick and dirty hack is nothing
but quick and dirty.

I wonder whether we should not try to fix this by making the process wait
on a heavyweight lock, if it has to wait. That would also get us out of
the rather grotty business of using a special-purpose signal to wake it
up. However, there's still a visibility problem, in that there'd be no
way to tell which other processes are blocking it (which is the thing
you *really* want to know).

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jaime Casanova 2014-04-14 15:45:29 server vs foreign server inconsistency
Previous Message Robert Haas 2014-04-14 14:56:20 Re: Signaling of waiting for a cleanup lock?