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

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: pgsql: Provide much better wait information in pg_stat_activity.
Дата
Msg-id CAFj8pRBDO-rbHgWoKVYuJkifa6zcTLFS9wfJ55ECeuqt8uAsaQ@mail.gmail.com
обсуждение исходный текст
Ответ на pgsql: Provide much better wait information in pg_stat_activity.  (Robert Haas <rhaas@postgresql.org>)
Список pgsql-committers
Hi

2016-03-10 19:55 GMT+01:00 Robert Haas <rhaas@postgresql.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


 

В списке pgsql-committers по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: pgsql: Rework wait for AccessExclusiveLocks on Hot Standby
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Refactor pull_var_clause's API to make it less tedious to extend