Postpone some end-of-recovery operations related to allowing WAL.
authorRobert Haas
Thu, 14 Oct 2021 15:55:50 +0000 (11:55 -0400)
committerRobert Haas
Thu, 14 Oct 2021 15:55:50 +0000 (11:55 -0400)
commit811051c2e7af1b030467760baf7ee0f4a22bc992
tree1513370be3c0f98ef655d273b87f99625596c85b
parent010e5233733aedf86634e1719d9536c42e18a27d
Postpone some end-of-recovery operations related to allowing WAL.

CreateOverwriteContrecordRecord(), UpdateFullPageWrites(),
PerformRecoveryXLogAction(), and CleanupAfterArchiveRecovery()
are moved somewhat later in StartupXLOG(). This is preparatory
work for a future patch that wants to allow recovery to end at one
time and only later start to allow WAL writes. To do that, it's
necessary to separate code that has to do with allowing WAL writes
from other things that need to happen simply because recovery is
ending, such as initializing shared memory data structures that
depend on information that might not be accurate before redo is
complete.

This commit does not achieve that goal, but it is a step in that
direction.  For example, there are a few different bits of code that
write things into WAL once we have finished recovery, and with this
change, those bits of code are closer to each other than previously,
with fewer unrelated bits of code interspersed.

Robert Haas and Amul Sul

Discussion: http://postgr.es/m/CAAJ_b97abMuq=470Wahun=aS1PHTSbStHtrjjPaD-C0YQ1AqVw@mail.gmail.com
src/backend/access/transam/xlog.c