Re: pgsql: Provide much better wait information in pg_stat_activity.

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Robert Haas <rhaas(at)postgresql(dot)org>
Cc: "pgsql-committers(at)postgresql(dot)org" <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Provide much better wait information in pg_stat_activity.
Date: 2016-03-10 20:44:33
Message-ID: CAFj8pRBDO-rbHgWoKVYuJkifa6zcTLFS9wfJ55ECeuqt8uAsaQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Hi

2016-03-10 19:55 GMT+01:00 Robert Haas <rhaas(at)postgresql(dot)org>:

> Provide much better wait information in pg_stat_activity.
>
> When a process is waiting for a heavyweight lock, we will now indicate
> the type of heavyweight lock for which it is waiting. Also, you can
> now see when a process is waiting for a lightweight lock - in which
> case we will indicate the individual lock name or the tranche, as
> appropriate - or for a buffer pin.
>
> Amit Kapila, Ildus Kurbangaliev, reviewed by me. Lots of helpful
> discussion and suggestions by many others, including Alexander
> Korotkov, Vladimir Borodin, and many others.
>
> Branch
> ------
> master
>
>
I am trying to test this feature, and there I see not actual data. Maybe
this behave is not related to this patch:

create table foo(a int);
insert into foo values(10);

session one:

begin; select * from foo for update;

session two:

begin; select * from foo for update;
session two is waiting

session one:
select * from pg_stat_activity -- I don't see correct information about
session two

session two:
rollback; begin; select * from foo where a = 10 for update;
session two is waiting again

session one:
select * from pg_stat_activity; -- The content is not changed

So content of pg_stat_activity is not correct in holder lock session.
Independent third session see valid content of pg_stat_activity.

Hypothesis: the pg_stat_activity is not refreshed under opened transaction?

Regards

Pavel

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-03-10 20:53:27 pgsql: Refactor pull_var_clause's API to make it less tedious to extend
Previous Message Simon Riggs 2016-03-10 19:27:16 pgsql: Rework wait for AccessExclusiveLocks on Hot Standby

Browse pgsql-hackers by date

  From Date Subject
Next Message Gavin Flower 2016-03-10 20:58:48 Re: Add generate_series(date,date) and generate_series(date,date,integer)
Previous Message Thomas Munro 2016-03-10 20:36:28 Re: WIP: Detecting SSI conflicts before reporting constraint violations