Re: New WAL record to detect the checkpoint redo location

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, Dilip Kumar <dilipbalaut@gmail.com>, Heikki Linnakangas <hlinnaka@iki.fi>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-10-12T07:27:19Z
Lists: pgsql-hackers
On Tue, Oct 10, 2023 at 02:43:34PM -0400, Robert Haas wrote:
> - I combined what were previously 0002 and 0003 into a single patch,
> since that's how this would get committed.
> 
> - I fixed up some comments.
> 
> - I updated commit messages.
> 
> Hopefully this is getting close to good enough.

I have looked at 0001, for now..  And it looks OK to me.

+        * Nonetheless, this case is simpler than the normal cases handled
+        * above, which must check for changes in doPageWrites and RedoRecPtr.
+        * Those checks are only needed for records that can contain
+        * full-pages images, and an XLOG_SWITCH record never does.
+        Assert(fpw_lsn == InvalidXLogRecPtr);

Right, that's the core reason behind the refactoring.  The assertion
is a good idea.
--
Michael

Commits

  1. During online checkpoints, insert XLOG_CHECKPOINT_REDO at redo point.

  2. Unify two isLogSwitch tests in XLogInsertRecord.