Re: removing global variable ThisTimeLineID

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: removing global variable ThisTimeLineID
Date: 2021-11-09 19:15:51
Message-ID: CA+TgmoYBQuYykPvJF6RAUjV8ua56QcdTxRvhfS=8EfJ190nb7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 8, 2021 at 10:31 PM Michael Paquier <michael(at)paquier(dot)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

Attachment Content-Type Size
v2-0001-More-cleanup-of-ThisTimeLineID.patch application/octet-stream 16.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Floris Van Nee 2021-11-09 19:28:32 RE: Commitfest 2021-11 Patch Triage - Part 2
Previous Message Michail Nikolaev 2021-11-09 19:05:49 Re: [PATCH] Full support for index LP_DEAD hint bits on standby