pgsql: StartupXLOG: Call CleanupAfterArchiveRecovery after XLogReportPa

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: StartupXLOG: Call CleanupAfterArchiveRecovery after XLogReportPa
Date: 2021-10-25 14:43:27
Message-ID: E1mf1CB-0000FL-3H@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

StartupXLOG: Call CleanupAfterArchiveRecovery after XLogReportParameters.

This does a better job grouping related operations together, since
all of the WAL records that we need to write prior to allowing WAL
writes generally and written by a single uninterrupted stretch of code.

Since CleanupAfterArchiveRecovery() just (1) runs recovery_end_command,
(2) removes non-parent xlog files, and (3) archives any final partial
segment, this should be safe, because all of those things are pretty
much unrelated to the WAL record written by XLogReportParameters().

Amul Sul, per a suggestion from me

Discussion: http://postgr.es/m/CAAJ_b97fysj6sRSQEfOHj-y8Jfd5uPqOgO74qast89B4WfD+TA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a75dbf7f9ee6ff0c0e2ab4b224b04fc50c4e6577

Modified Files
--------------
src/backend/access/transam/xlog.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2021-10-25 15:03:37 pgsql: Remove useless code from CreateReplicationSlot.
Previous Message Amit Kapila 2021-10-25 10:51:26 Re: pgsql: Document XLOG_INCLUDE_XID a little better