summaryrefslogtreecommitdiff
path: root/src/backend/replication/walsender.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/replication/walsender.c')
-rw-r--r--src/backend/replication/walsender.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index 4c7d55488ed..2e944a93905 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -2941,12 +2941,14 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
/*
* Treat a standby such as a pg_basebackup background process
* which always returns an invalid flush location, as an
- * asynchronous standby.
+ * asynchronous standby. WAL sender must be streaming or
+ * stopping.
*/
sync_priority[i] = XLogRecPtrIsInvalid(walsnd->flush) ?
0 : walsnd->sync_standby_priority;
- if (walsnd->state == WALSNDSTATE_STREAMING &&
+ if ((walsnd->state == WALSNDSTATE_STREAMING ||
+ walsnd->state == WALSNDSTATE_STOPPING) &&
walsnd->sync_standby_priority > 0 &&
(priority == 0 ||
priority > walsnd->sync_standby_priority) &&