Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ae7SS-0007KI-Cq for pgsql-committers@arkaria.postgresql.org; Thu, 10 Mar 2016 20:45:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ae7SR-0000we-Qa for pgsql-committers@arkaria.postgresql.org; Thu, 10 Mar 2016 20:45:19 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ae7SR-0000wX-Bu for pgsql-committers@postgresql.org; Thu, 10 Mar 2016 20:45:19 +0000 Received: from mail-yk0-x232.google.com ([2607:f8b0:4002:c07::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ae7SM-0006SL-0d; Thu, 10 Mar 2016 20:45:18 +0000 Received: by mail-yk0-x232.google.com with SMTP id z7so40594663yka.0; Thu, 10 Mar 2016 12:45:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=p79xyaQqIigr9UY1IbFssZ0wsiJMOL1guI3Fd7I+7R4=; b=I59ZqmL8U+278Co/tyaOG69M/iCN4EgIPLenvHD15Iu37Fmi25aUH/NTiSHDV7ITte fMjQ5QVwbURSRcenbBXL73rO4wwh/i7jkKtEM0LYHA4ejgQH8AEsGIqC7jJQe0hwg/Wg bsrwgGfPCj5uLg3C8y+A1arG8XxK2BXZWN/rtuR4P49vNvJTZ8oPf+Th7jE1HZ/lZP6A pxOMTXGt4+tIzFR8IOp8Rj7gRq6ICktlhJAVHJnksWOu7PVTf3ipYXOWD1b78oHV2PIA 9+FKcp1op/6GT4wZr0Y2JbXOWLGssUNLWmjapT90Cy1prLNXavPq7YhpHYA56QdQIScd O8rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=p79xyaQqIigr9UY1IbFssZ0wsiJMOL1guI3Fd7I+7R4=; b=EbYNWzMoS/o9F09LS6wD/K5+kGpdpxOFugqJRqNeWnvurnFO1RN/iXqGoiHppjx2E1 bPBspG3/ksYhpYirYxI+CfnMe5w7kasFihzgqjGtyOUU+VF+B3WRFareWIgnBPBUKJbo 1oaTBuSiMd+eSN5Di5zeD/tUAgK/Lxkfxb+JgjsIxWXKmLSi7gLIPeWgVm+/U/0yS7CU 1b2plnoX5xAGiTGC4H02DxdfUDVmXgvPCXvEiEvP6PPfppc20v8/KDH4LmMjlpIj3gR1 SXXFCcTpyLBRDN3xlv2vOSjVmpnqsSXcBT7qUgAjsdhoul3HtbxFCOozkENJUaB0pdu/ 30Ow== X-Gm-Message-State: AD7BkJJXGUwEMkzy9KXSsWoZxzfqH0bhFTOwPI0TmYXDnSvzrMWxdTiqfhwyL+CMb++DfNBKcfPoMgjktfLs2Q== X-Received: by 10.37.45.214 with SMTP id t205mr3135466ybt.94.1457642713196; Thu, 10 Mar 2016 12:45:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.13.228.193 with HTTP; Thu, 10 Mar 2016 12:44:33 -0800 (PST) In-Reply-To: References: From: Pavel Stehule Date: Thu, 10 Mar 2016 21:44:33 +0100 Message-ID: Subject: Re: pgsql: Provide much better wait information in pg_stat_activity. To: Robert Haas Cc: "pgsql-committers@postgresql.org" Content-Type: multipart/alternative; boundary=001a11350e58212f2b052db7e45b X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org --001a11350e58212f2b052db7e45b Content-Type: text/plain; charset=UTF-8 Hi 2016-03-10 19:55 GMT+01:00 Robert Haas : > 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 --001a11350e58212f2b052db7e45b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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.=C2=A0 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.=C2=A0 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. Ma= ybe this behave is not related to this patch:

create tabl= e foo(a int);
insert into foo values(10);

s= ession one:

begin; select * from foo for update;

=
session two:

begin; select * from foo for upda= te;
session two is waiting

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

session two:
rollba= ck; begin; select * from foo where a =3D 10 for update;
sessi= on two is waiting again

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

S= o content of pg_stat_activity is not correct in holder lock session. Indepe= ndent third session see valid content of pg_stat_activity.

Hypothesis: the pg_stat_activity is not refreshed under opened transactio= n?

Regards

Pavel


=C2=A0

--001a11350e58212f2b052db7e45b--