pgsql: Properly set base backup backends to active in pg_stat_activity - Mailing list pgsql-committers

From Magnus Hagander
Subject pgsql: Properly set base backup backends to active in pg_stat_activity
Date
Msg-id E1eUwaZ-000419-Ha@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Properly set base backup backends to active in pg_stat_activity

When walsenders were included in pg_stat_activity, only the ones
actually streaming WAL were listed as active when they were active. In
particular, the connections sending base backups were listed as being
idle. Which means that a regular pg_basebackup would show up with one
active and one idle connection, when both were active.

This patch updates to set all walsenders to active when they are
(including those doing very fast things like IDENTIFY_SYSTEM), and then
back to idle. Details about exactly what they are doing is available in
pg_stat_replication.

Patch by me, review by Michael Paquier and David Steele.

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/backend/replication/walsender.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)


pgsql-committers by date:

Previous
From: Simon Riggs
Date:
Subject: pgsql: Fix race condition when changing synchronous_standby_names
Next
From: Andres Freund
Date:
Subject: Re: pgsql: Use new overflow aware integer operations.