diff options
Diffstat (limited to 'src/backend/replication/walreceiverfuncs.c')
-rw-r--r-- | src/backend/replication/walreceiverfuncs.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/replication/walreceiverfuncs.c b/src/backend/replication/walreceiverfuncs.c index d414808c9f2..e5ad84393fa 100644 --- a/src/backend/replication/walreceiverfuncs.c +++ b/src/backend/replication/walreceiverfuncs.c @@ -260,12 +260,13 @@ RequestXLogStreaming(TimeLineID tli, XLogRecPtr recptr, const char *conninfo) walrcv->startTime = now; /* - * If this is the first startup of walreceiver, we initialize receivedUpto - * and latestChunkStart to receiveStart. + * If this is the first startup of walreceiver (on this timeline), + * initialize receivedUpto and latestChunkStart to the starting point. */ - if (walrcv->receiveStart == 0) + if (walrcv->receiveStart == 0 || walrcv->receivedTLI != tli) { walrcv->receivedUpto = recptr; + walrcv->receivedTLI = tli; walrcv->latestChunkStart = recptr; } walrcv->receiveStart = recptr; |