Re: removing global variable ThisTimeLineID
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-11-09T03:30:53Z
Lists: pgsql-hackers
On Mon, Nov 08, 2021 at 12:49:52PM -0500, Robert Haas wrote: > Even with this patch, the name ThisTimeLineID is still used for > multiple purposes. It remains part of the CheckPoint struct, and also > part of the xl_end_of_recovery struct. But in both of those cases, the > name ThisTimeLineID actually makes sense, because what we're thinking > about is whether there's a timeline change, so we have ThisTimeLineID > and PrevTimeLineID and it seems fairly clear what that's supposed to > mean. I got to wonder if it would be better to bite the bullet here for these two looking at your patch, but I am fine to keep things as they are, as well. > Thoughts? I think that this patch is an improvement. @@ -6686,8 +6682,8 @@ StartupXLOG(void) - TimeLineID ThisTimeLineID, - PrevTimeLineID; + TimeLineID replayTLI, + newTLI; One problem with newTLI is that this conflicts with the declaration around 7663 in xlog.c, where we check after a TLI switch when replaying such a record. Perhaps this could be named newInsertTLI, for example. -- Michael
Commits
-
More cleanup of 'ThisTimeLineID'.
- a27048cbcb58 15.0 landed
-
Change ThisTimeLineID from a global variable to a local variable.
- 4a92a1c3d1c3 15.0 landed
-
Remove all use of ThisTimeLineID global variable outside of xlog.c
- e997a0c64286 15.0 landed
-
Don't set ThisTimeLineID when there's no reason to do so.
- caf1f675b88d 15.0 landed
-
When fetching WAL for a basebackup, report errors with a sensible TLI.
- 2f5c4397c39d 15.0 cited
-
Remove useless code from CreateReplicationSlot.
- 902a2c280012 15.0 cited