From b8aca12d77612007ebde22db14e3971ef664d553 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 4 Jul 2012 15:10:46 +0200 Subject: Always treat a standby returning an an invalid flush location as async This ensures that a standby such as pg_receivexlog will not be selected as sync standby - which would cause the master to block waiting for a location that could never happen. Fujii Masao --- src/backend/replication/walreceiver.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/backend/replication/walreceiver.c') diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c index 18b4727fa81..7058b888ca3 100644 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -276,6 +276,11 @@ WalReceiverMain(void) walrcv_connect(conninfo, startpoint); DisableWalRcvImmediateExit(); + /* Initialize LogstreamResult, reply_message and feedback_message */ + LogstreamResult.Write = LogstreamResult.Flush = GetXLogReplayRecPtr(); + MemSet(&reply_message, 0, sizeof(reply_message)); + MemSet(&feedback_message, 0, sizeof(feedback_message)); + /* Loop until end-of-streaming or error */ for (;;) { -- cgit v1.2.3