xlog.c: Adjust some more functions to pass the TLI around.
authorRobert Haas <rhaas@postgresql.org>
Mon, 1 Nov 2021 18:25:21 +0000 (14:25 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 1 Nov 2021 18:25:21 +0000 (14:25 -0400)
commitce83825bc6ea756bf3cbd2e254ed737cd9bde427
tree35ab533213627fb6464c71cd7dd115e39f42429f
parent17d9c1e75fb233ba64b135696f005a85d04ca814
xlog.c: Adjust some more functions to pass the TLI around.

Adjust ReadRecord() to take the replayTLI as an argument. Use
that value, rather than ThisTimeLineID, to set the minimum
recovery point TLI. Also pass the value through to ReadRecord()
via XLogPageReadPrivate, and from there pass it down to
WaitForWALToBecomeAvailable() and rescanLatestTimeLine(),
so that the latter doesn't need the global variable
ThisTimeLineID either.

To make all this work, a few other changes are needed. First,
pass a TLI down to ReadCheckpointRecord so that it can pass it
on to ReadRecord. Second, have read_backup_label() return the
timeline it obtains from the backup_label file and install
that temporarily as ThisTimeLineID. The reason for the latter
change is that, previously, ThisTimeLineID could be
uninitialized when ReadRecord() was called, as when we were
reading the checkpoint record. Though that seems to have no
consequences about which we need to be concerned, it's better
to have a legal value all the time.
src/backend/access/transam/xlog.c