Re: removing global variable ThisTimeLineID - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: removing global variable ThisTimeLineID
Date
Msg-id YYnrbd/qlNZz3xic@paquier.xyz
Whole thread Raw
In response to Re: removing global variable ThisTimeLineID  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: removing global variable ThisTimeLineID
List 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

Attachment

pgsql-hackers by date:

Previous
From: Greg Nancarrow
Date:
Subject: Re: Failed transaction statistics to measure the logical replication progress
Next
From: Fujii Masao
Date:
Subject: Re: [PATCH] pg_stat_statements Configuration Parameters Documentation