From: Robert Haas Date: Thu, 28 Oct 2021 16:59:56 +0000 (-0400) Subject: walsender.c: In ReadReplicationSlot, don't rely on ThisTimeLineID. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=d2ead068577ade165366393d101c74fe6074a1f9;p=users%2Frhaas%2Fpostgres.git walsender.c: In ReadReplicationSlot, don't rely on ThisTimeLineID. At the point we use the global variable, it will have just been updated by RecoveryInProgress(), if needed. But let's call GetCurrentTimeLineID() instead. --- diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index 10603b2d86..2eb0006d92 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -537,7 +537,7 @@ ReadReplicationSlot(ReadReplicationSlotCmd *cmd) if (RecoveryInProgress()) (void) GetXLogReplayRecPtr(¤t_timeline); else - current_timeline = ThisTimeLineID; + current_timeline = GetCurrentTimeLineID(); timeline_history = readTimeLineHistory(current_timeline); slots_position_timeline = tliOfPointInHistory(slot_contents.data.restart_lsn,