From: Kyotaro Horiguchi Date: Wed, 9 Dec 2020 17:22:41 +0900 Subject: [PATCH v2 2/2] Fix a bug of timeline-tracking while sending a historic timeline Since PG13, we should track a timeline switch while sending a historic timeline running physical replication, but WalSndSegmentOpen fails to do that. It is a thinko of 709d003fbd. --- src/backend/replication/walsender.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index fe0d368a35..8545c6c423 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -2491,7 +2491,7 @@ WalSndSegmentOpen(XLogReaderState *state, XLogSegNo nextSegNo, XLogSegNo endSegNo; XLByteToSeg(sendTimeLineValidUpto, endSegNo, state->segcxt.ws_segsize); - if (state->seg.ws_segno == endSegNo) + if (nextSegNo == endSegNo) *tli_p = sendTimeLineNextTLI; } -- 2.27.0 ----Next_Part(Mon_Jan__4_12_06_10_2021_267)----