From fc3d4a44e9375f79709f470cb3c83d4ca28fb370 Mon Sep 17 00:00:00 2001 From: Simon Riggs Date: Mon, 12 Sep 2016 08:57:14 +0100 Subject: [PATCH] Identify walsenders in pg_stat_activity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following 8299471c37fff0b walsender procs are now visible in pg_stat_activity. Set query to ‘walsender’ for walsender procs to allow them to be identified. Discussion:CAB7nPqS8c76KPSufK_HSDeYrbtg+zZ7D0EEkjeM6txSEuCB_jA@mail.gmail.com Michael Paquier, issue raised by Fujii Masao, reviewed by Tom Lane --- src/backend/replication/walsender.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index 1ea2a5cfdf..c7743da034 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -1806,6 +1806,9 @@ WalSndLoop(WalSndSendDataCallback send_data) last_reply_timestamp = GetCurrentTimestamp(); waiting_for_ping_response = false; + /* Report to pgstat that this process is a WAL sender */ + pgstat_report_activity(STATE_RUNNING, "walsender"); + /* * Loop until we reach the end of this timeline or the client requests to * stop streaming.