Re: Signaling of waiting for a cleanup lock? - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Signaling of waiting for a cleanup lock?
Date
Msg-id 20140414145005.GU4161@awork2.anarazel.de
Whole thread Raw
In response to Re: Signaling of waiting for a cleanup lock?  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Signaling of waiting for a cleanup lock?
Re: Signaling of waiting for a cleanup lock?
List pgsql-hackers
On 2014-04-14 15:45:45 +0100, Simon Riggs wrote:
> On 13 April 2014 16:44, Andres Freund <andres@2ndquadrant.com> wrote:
> > On 2014-04-12 17:40:34 -0400, Robert Haas wrote:
> >> On Fri, Apr 11, 2014 at 10:28 AM, Andres Freund <andres@2ndquadrant.com> wrote:
> >> > VACUUM sometimes waits synchronously for a cleanup lock on a heap
> >> > page. Sometimes for a long time. Without reporting it externally.
> >> > Rather confusing ;).
> >> >
> >> > Since we only take cleanup locks around vacuum, how about we report at
> >> > least in pgstat that we're waiting? At the moment, there's really no way
> >> > to know if that's what's happening.
> >>
> >> That seems like a pretty good idea to me.
> >
> > 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.

> Easy to set the ps message also

That actually makes it considerably more expensive since we'd need to
save the old string somewhere. I am not sure it will be relevant, but
it's not as easy a sell as just setting a single boolean.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Signaling of waiting for a cleanup lock?
Next
From: Robert Haas
Date:
Subject: Re: Minor improvements in alter_table.sgml