Re: Split xlog.c

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: alvherre(at)alvh(dot)no-ip(dot)org, andres(at)anarazel(dot)de, vignesh21(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Split xlog.c
Date: 2021-11-22 23:11:18
Message-ID: ff82d82b-8905-8f94-740d-da8d52baa6e0@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 17/09/2021 06:10, Kyotaro Horiguchi wrote:
> recoveryStopReason is always acquired but it is used only after
> archive recovery. I'm not sure about reason for the variable to
> live in that wide context. Couldn't we remove the variable then
> call getRecoveryStopReason() directly at the required place?

Robert commented on the same thing, see my reply there.

> 0002:
>
> heapam.c, clog.c, twophase.c, dbcommands.c doesn't need xlogrecvoer.h.

Cleaned that up in v7, thanks!

>> XLogRecCtl
>
> "Rec" looks like Record. Couldn't we use "Rcv", "Recov" or just
> "Recovery" instead?

I never made that association before, but now I cannot unsee it :-). I
changed it to XLogRecoveryCtl.

>> TimeLineID PrevTimeLineID;
>> TransactionId oldestActiveXID;
>> bool promoted = false;
>> EndOfWalRecoveryInfo *endofwal;
>> bool haveTblspcMap;
>
> This is just a matter of taste but the "endofwal" looks somewhat
> alien in the variables.

Changed to "endOfRecoveryInfo".

>
> xlog.c:
> +void
> +SwitchIntoArchiveRecovery(XLogRecPtr EndRecPtr)
>
> Isn't this a function of xlogrecovery.c? Or rather isn't
> minRecoveryPoint-related stuff of xlogrecovery.c?

Updating the control file is xlog.c's responsibility. There are two
different minRecoveryPoints:

1. xlogrecovery.c has a copy of the minRecoveryPoint from the control
file, so that it knows when we have reached consistency.

2. xlog.c is responsible for updating the minRecoveryPoint in the
control file, after consistency has been reached.

SwitchIntoArchiveRecovery() is called on the transition.

- Heikki

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2021-11-22 23:57:45 Re: Reduce function call costs on ELF platforms
Previous Message Heikki Linnakangas 2021-11-22 23:10:36 Re: Split xlog.c