pgsql: pg_stat_activity: show NULL stmt start time for walsenders

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_stat_activity: show NULL stmt start time for walsenders
Date: 2020-01-07 20:50:45
Message-ID: E1iovoL-0003KJ-HO@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2020-01-07 21:13:07 pgsql: pg_stat_activity: show NULL stmt start time for walsenders
Previous Message Robert Haas 2020-01-07 19:37:20 pgsql: tableam: New callback relation_fetch_toast_slice.