Fix invalid checksum state transition in checkpoints

Commit 78e950cb8 added checksum state handling to all XLOG_CHECKPOINT
records which caused unnecessary state transitions and emission of
procsignal barriers.  Remove as only the _REDO record need to handle
checksum state.  Barrier emission is also consistently made after
controlfile updates to avoid race conditions.

Additionally, interrupts are held between calling ProcSignalInit and
InitLocalDataChecksumState to remove a window where otherwise invalid
state transitions can happen.

Also remove a pointless assertion on Controlfile which will never hit.

Author: Tomas Vondra <[email protected]>
Author: Daniel Gustafsson <[email protected]>
Reviewed-by: Ayush Tiwari <[email protected]>
Reviewed-by: SATYANARAYANA NARLAPURAM <[email protected]>
Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/25b922ec5825e6938c28cdae718aa70b8f11fd50

Modified Files
--------------
src/backend/access/transam/xlog.c           | 107 +++++++++-------------------
src/backend/postmaster/auxprocess.c         |  10 +++
src/backend/postmaster/datachecksum_state.c |   8 +--
src/backend/utils/init/postinit.c           |  10 +++
4 files changed, 56 insertions(+), 79 deletions(-)

Reply via email to