aboutsummaryrefslogtreecommitdiff
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.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index d078501814c..0ad6804e552 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -316,6 +316,16 @@ StartReplication(StartReplicationCmd * cmd)
StringInfoData buf;
/*
+ * Let postmaster know that we're streaming. Once we've declared us as
+ * a WAL sender process, postmaster will let us outlive the bgwriter and
+ * kill us last in the shutdown sequence, so we get a chance to stream
+ * all remaining WAL at shutdown, including the shutdown checkpoint.
+ * Note that there's no going back, and we mustn't write any WAL records
+ * after this.
+ */
+ MarkPostmasterChildWalSender();
+
+ /*
* Check that we're logging enough information in the WAL for
* log-shipping.
*