Re: RFC: replace pg_stat_activity.waiting with something more descriptive - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: RFC: replace pg_stat_activity.waiting with something more descriptive
Date
Msg-id 55C15CF1.4080606@agliodbs.com
Whole thread Raw
In response to RFC: replace pg_stat_activity.waiting with something more descriptive  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: RFC: replace pg_stat_activity.waiting with something more descriptive  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 06/25/2015 07:50 AM, Tom Lane wrote:
> To do that, we'd have to change the semantics of the 'waiting' column so
> that it becomes true for non-heavyweight-lock waits.  I'm not sure whether
> that's a good idea or not; I'm afraid there may be client-side code that
> expects 'waiting' to indicate that there's a corresponding row in
> pg_locks.  If we're willing to do that, then I'd be okay with
> allowing wait_status to be defined as "last thing waited for"; but the
> two points aren't separable.

Speaking as someone who writes a lot of monitoring and alerting code,
changing the meaning of the waiting column is OK as long as there's
still a boolean column named "waiting" and it means "query blocked" in
some way.

Users are used to pg_stat_activity.waiting failing to join against
pg_locks ... for one thing, there's timing issues there.  So pretty much
everything I've seen uses outer joins anyway.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



pgsql-hackers by date:

Previous
From: Takashi Horikawa
Date:
Subject: Re: patch: prevent user from setting wal_buffers over 2GB bytes
Next
From: Michael Paquier
Date:
Subject: Re: tablecmds.c and lock hierarchy