Skip to content

Commit a75dbf7

Browse files
committed
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
1 parent 166f943 commit a75dbf7

File tree

1 file changed

+4
-4
lines changed
  • src/backend/access/transam

1 file changed

+4
-4
lines changed

src/backend/access/transam/xlog.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -8094,17 +8094,17 @@ StartupXLOG(void)
80948094
if (!XLogRecPtrIsInvalid(XLogCtl->lastReplayedEndRecPtr))
80958095
promoted = PerformRecoveryXLogAction();
80968096

8097-
/* If this is archive recovery, perform post-recovery cleanup actions. */
8098-
if (ArchiveRecoveryRequested)
8099-
CleanupAfterArchiveRecovery(EndOfLogTLI, EndOfLog);
8100-
81018097
/*
81028098
* If any of the critical GUCs have changed, log them before we allow
81038099
* backends to write WAL.
81048100
*/
81058101
LocalSetXLogInsertAllowed();
81068102
XLogReportParameters();
81078103

8104+
/* If this is archive recovery, perform post-recovery cleanup actions. */
8105+
if (ArchiveRecoveryRequested)
8106+
CleanupAfterArchiveRecovery(EndOfLogTLI, EndOfLog);
8107+
81088108
/*
81098109
* Local WAL inserts enabled, so it's time to finish initialization of
81108110
* commit timestamp.

0 commit comments

Comments
 (0)