diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index 0ba2ad4414..9207a48910 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -711,8 +711,11 @@ WalSndLoop(void) XLogSend(output_message, &caughtup); if (caughtup && !pq_is_send_pending()) { - ProcDiePending = true; - continue; /* don't want to wait more */ + /* Inform the standby that XLOG streaming is done */ + pq_puttextmessage('C', "COPY 0"); + pq_flush(); + + proc_exit(0); } } }