pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: pg_stat_activity: show NULL stmt start time for walsenders
6+ messages / 3 participants
[nested] [flat]

* pgsql: pg_stat_activity: show NULL stmt start time for walsenders
@ 2020-01-07 20:50  Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 1 reply; 6+ messages in thread

From: Alvaro Herrera @ 2020-01-07 20:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_stat_activity: show NULL stmt start time for walsenders

Returning a non-NULL time is pointless, sinc a walsender is not a
process that would be running normal transactions anyway, but the code
was unintentionally exposing the process start time intermittently,
which was not only bogus but it also confused monitoring systems looking
for idle transactions.  Fix by avoiding all updates in walsenders.

Backpatch to 11, where walsenders started appearing in pg_stat_activity.

Reported-by: Tomas Vondra
Discussion: https://postgr.es/m/20191209234409.exe7osmyalwkt5j4@development

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b175bd59fa54a90d21bc541f812643ac45281b98

Modified Files
--------------
src/backend/access/transam/xact.c | 7 +++++++
1 file changed, 7 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: pg_stat_activity: show NULL stmt start time for walsenders
@ 2020-01-07 20:50  Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Alvaro Herrera @ 2020-01-07 20:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_stat_activity: show NULL stmt start time for walsenders

Returning a non-NULL time is pointless, sinc a walsender is not a
process that would be running normal transactions anyway, but the code
was unintentionally exposing the process start time intermittently,
which was not only bogus but it also confused monitoring systems looking
for idle transactions.  Fix by avoiding all updates in walsenders.

Backpatch to 11, where walsenders started appearing in pg_stat_activity.

Reported-by: Tomas Vondra
Discussion: https://postgr.es/m/20191209234409.exe7osmyalwkt5j4@development

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/896db774e5b0a851792f02c8a19ea9b07c9dcc23

Modified Files
--------------
src/backend/access/transam/xact.c | 7 +++++++
1 file changed, 7 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: pg_stat_activity: show NULL stmt start time for walsenders
@ 2020-01-07 20:50  Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Alvaro Herrera @ 2020-01-07 20:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_stat_activity: show NULL stmt start time for walsenders

Returning a non-NULL time is pointless, sinc a walsender is not a
process that would be running normal transactions anyway, but the code
was unintentionally exposing the process start time intermittently,
which was not only bogus but it also confused monitoring systems looking
for idle transactions.  Fix by avoiding all updates in walsenders.

Backpatch to 11, where walsenders started appearing in pg_stat_activity.

Reported-by: Tomas Vondra
Discussion: https://postgr.es/m/20191209234409.exe7osmyalwkt5j4@development

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fce9ba8192b48d7b4a57a19d92044c4f378a41a0

Modified Files
--------------
src/backend/access/transam/xact.c | 7 +++++++
1 file changed, 7 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: pg_stat_activity: show NULL stmt start time for walsenders
@ 2020-01-07 21:13  Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Alvaro Herrera @ 2020-01-07 21:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_stat_activity: show NULL stmt start time for walsenders

Returning a non-NULL time is pointless, sinc a walsender is not a
process that would be running normal transactions anyway, but the code
was unintentionally exposing the process start time intermittently,
which was not only bogus but it also confused monitoring systems looking
for idle transactions.  Fix by avoiding all updates in walsenders.

Backpatch to pg10: previously I misidentified the branches that show
auxiliary processes in pg_stat_activity.

Reported-by: Tomas Vondra
Discussion: https://postgr.es/m/20191209234409.exe7osmyalwkt5j4@development

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8de3b68faffcb5898244bd8af3abfb6edb11543f

Modified Files
--------------
src/backend/access/transam/xact.c | 7 +++++++
1 file changed, 7 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: pg_stat_activity: show NULL stmt start time for walsenders
@ 2020-01-07 21:16  Alvaro Herrera <alvherre@2ndquadrant.com>
  parent: Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 1 reply; 6+ messages in thread

From: Alvaro Herrera @ 2020-01-07 21:16 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

On 2020-Jan-07, Alvaro Herrera wrote:

> pg_stat_activity: show NULL stmt start time for walsenders
> 
> Returning a non-NULL time is pointless, sinc a walsender is not a
> process that would be running normal transactions anyway, but the code
> was unintentionally exposing the process start time intermittently,
> which was not only bogus but it also confused monitoring systems looking
> for idle transactions.  Fix by avoiding all updates in walsenders.
> 
> Backpatch to 11, where walsenders started appearing in pg_stat_activity.

So I misidentified things; it's not commit be87b70b6117 (pg11) that put
auxiliary processes in pg_stat_activity, but fc70a4b0df38 (pg10).  So I
applied it back to pg10 also.  (I did verify that walsenders appear with
a xact_time in pg_stat_activity in pg10 before this patch, and not
afterwards.)

We're still computing useless xact start timestamps in branches 9.4 -
9.6, but I don't think we care.  (If we do care, then we probably also
care about xact *stop* time ... but meh.)

Thanks

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: pg_stat_activity: show NULL stmt start time for walsenders
@ 2020-01-08 01:58  Michael Paquier <michael@paquier.xyz>
  parent: Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2020-01-08 01:58 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: pgsql-committers@lists.postgresql.org

Hi Alvaro,

On Tue, Jan 07, 2020 at 06:16:24PM -0300, Alvaro Herrera wrote:
> So I misidentified things; it's not commit be87b70b6117 (pg11) that put
> auxiliary processes in pg_stat_activity, but fc70a4b0df38 (pg10).  So I
> applied it back to pg10 also.  (I did verify that walsenders appear with
> a xact_time in pg_stat_activity in pg10 before this patch, and not
> afterwards.)
> 
> We're still computing useless xact start timestamps in branches 9.4 -
> 9.6, but I don't think we care.  (If we do care, then we probably also
> care about xact *stop* time ... but meh.)

This commit has angered the buildfarm gods on HEAD and stable
branches, with failures in subscriptionCheck.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2020-01-08 01:58 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 20:50 pgsql: pg_stat_activity: show NULL stmt start time for walsenders Alvaro Herrera <alvherre@alvh.no-ip.org>
2020-01-07 21:16 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2020-01-08 01:58   ` Michael Paquier <michael@paquier.xyz>
2020-01-07 20:50 pgsql: pg_stat_activity: show NULL stmt start time for walsenders Alvaro Herrera <alvherre@alvh.no-ip.org>
2020-01-07 20:50 pgsql: pg_stat_activity: show NULL stmt start time for walsenders Alvaro Herrera <alvherre@alvh.no-ip.org>
2020-01-07 21:13 pgsql: pg_stat_activity: show NULL stmt start time for walsenders Alvaro Herrera <alvherre@alvh.no-ip.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox