From 68e605b9ef37e9b3e96b97f71857efabd95d5321 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Thu, 14 Apr 2022 11:10:13 -0400 Subject: 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.horikyota.ntt@gmail.com --- src/backend/access/transam/xloginsert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/access/transam/xloginsert.c') diff --git a/src/backend/access/transam/xloginsert.c b/src/backend/access/transam/xloginsert.c index b51b0edd67c..24a6f3148b1 100644 --- a/src/backend/access/transam/xloginsert.c +++ b/src/backend/access/transam/xloginsert.c @@ -899,7 +899,7 @@ XLogSaveBufferForHint(Buffer buffer, bool buffer_std) /* * Ensure no checkpoint can change our view of RedoRecPtr. */ - Assert((MyPgXact->delayChkpt & DELAY_CHKPT_START) != 0); + Assert(MyPgXact->delayChkpt); /* * Update RedoRecPtr so that we can make the right decision -- cgit v1.2.3