Re: Split xlog.c

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: hlinnaka(at)iki(dot)fi
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-09-17 03:10:17
Message-ID: 20210917.121017.1324801335565936402.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello.

At Thu, 16 Sep 2021 11:23:46 +0300, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote in
> Here is another rebase.

I have several comments on this.

0001:

I understand this is almost simple relocation of code fragments. But
it seems introducing some behavioral changes.

PublishStartProcessInformation() was changed to be called while
crash recovery or on standalone server. Maybe it is harmless and
might be more consistent, so I'm fine with it.

Another call to ResetUnloggedRelations is added before redo start,
that seems fine.

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?

0002:

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

> XLogRecCtl

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

> 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.

xlog.c:
+void
+SwitchIntoArchiveRecovery(XLogRecPtr EndRecPtr)

Isn't this a function of xlogrecovery.c? Or rather isn't
minRecoveryPoint-related stuff of xlogrecovery.c?

0003;

Just looks fine. I might want to remove the parameter xlogreader
from ApplyWalRecord, but that seems cause more harm than good.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2021-09-17 04:06:41 Re: Column Filtering in Logical Replication
Previous Message Fujii Masao 2021-09-17 02:58:35 Re: Refactoring postgres_fdw code to rollback remote transaction