Rethink the delay-checkpoint-end mechanism in the back-branches.
authorRobert Haas
Thu, 14 Apr 2022 15:10:07 +0000 (11:10 -0400)
committerRobert Haas
Thu, 14 Apr 2022 15:10:07 +0000 (11:10 -0400)
commit10520f4346876aad4941797c2255a21bdac74739
tree49409e65ff1a82a8bfe0533a3dc9f4df57ffd18d
parentdf6bbe73b86cda28472b9ecc61ac2deff5b2837b
Rethink the delay-checkpoint-end mechanism in the back-branches.

The back-patch of commit bbace5697df12398e87ffd9879171c39d27f5b33 had
the unfortunate effect of changing the layout of PGPROC in the
back-branches, which could break extensions. This happened because it
changed the delayChkpt from type bool to type int. So, change it back,
and add a new bool delayChkptEnd field instead. The new field should
fall within what used to be padding space within the struct, and so
hopefully won't cause any extensions to break.

Per report from Markus Wanner and discussion with Tom Lane and others.

Patch originally by me, somewhat revised by Markus Wanner per a
suggestion from Michael Paquier. A very similar patch was developed
by Kyotaro Horiguchi, but I failed to see the email in which that was
posted before writing one of my own.

Discussion: http://postgr.es/m/CA+Tgmoao-kUD9c5nG5sub3F7tbo39+cdr8jKaOVEs_1aBWcJ3Q@mail.gmail.com
Discussion: http://postgr.es/m/20220406.164521.17171257901083417[email protected]
src/backend/access/transam/multixact.c
src/backend/access/transam/twophase.c
src/backend/access/transam/xact.c
src/backend/access/transam/xlog.c
src/backend/access/transam/xloginsert.c
src/backend/catalog/storage.c
src/backend/storage/buffer/bufmgr.c
src/backend/storage/ipc/procarray.c
src/include/storage/proc.h
src/include/storage/procarray.h