Re: removing global variable ThisTimeLineID
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-11-09T19:15:51Z
Lists: pgsql-hackers
Attachments
- v2-0001-More-cleanup-of-ThisTimeLineID.patch (application/octet-stream) patch v2-0001
On Mon, Nov 8, 2021 at 10:31 PM Michael Paquier <michael@paquier.xyz> wrote: > I think that this patch is an improvement. Cool. > @@ -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. That's a good point. However, since I think newTLI is already in use in some of the functions StartupXLOG() calls, and since I think it would be good to use the same name in StartupXLOG() as in the functions that it calls, what I'd prefer to do is rename the newTLI variable in the inner scope to newReplayTLI, as in the attached v2. -- Robert Haas EDB: http://www.enterprisedb.com
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