walsender.c: In ReadReplicationSlot, don't rely on ThisTimeLineID.
authorRobert Haas <[email protected]>
Thu, 28 Oct 2021 16:59:56 +0000 (12:59 -0400)
committerRobert Haas <[email protected]>
Fri, 29 Oct 2021 17:38:50 +0000 (13:38 -0400)
At the point we use the global variable, it will have just been
updated by RecoveryInProgress(), if needed. But let's call
GetCurrentTimeLineID() instead.

src/backend/replication/walsender.c

index 10603b2d86272ebbabf3d32158733b17a5671aa5..2eb0006d92e4d89a6d1c71e5ca70b2c469d32950 100644 (file)
@@ -537,7 +537,7 @@ ReadReplicationSlot(ReadReplicationSlotCmd *cmd)
                        if (RecoveryInProgress())
                                (void) GetXLogReplayRecPtr(&current_timeline);
                        else
-                               current_timeline = ThisTimeLineID;
+                               current_timeline = GetCurrentTimeLineID();
 
                        timeline_history = readTimeLineHistory(current_timeline);
                        slots_position_timeline = tliOfPointInHistory(slot_contents.data.restart_lsn,