Re: New WAL record to detect the checkpoint redo location - Mailing list pgsql-hackers

From Robert Haas
Subject Re: New WAL record to detect the checkpoint redo location
Date
Msg-id CA+TgmoZ_C1DKuNT0w13_b_6J8JgSupHFSLBCKgQdhJf3FannbA@mail.gmail.com
Whole thread Raw
In response to Re: New WAL record to detect the checkpoint redo location  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: New WAL record to detect the checkpoint redo location
Re: New WAL record to detect the checkpoint redo location
Re: New WAL record to detect the checkpoint redo location
List pgsql-hackers
On Mon, Sep 18, 2023 at 2:57 PM Robert Haas <robertmhaas@gmail.com> wrote:
> I've been brainstorming about this today, trying to figure out some
> ideas to make it work.

Here are some patches.

0001 refactors XLogInsertRecord to unify a couple of separate tests of
isLogSwitch, hopefully making it cleaner and cheaper to add more
special cases.

0002 is a very minimal patch to add XLOG_CHECKPOINT_REDO without using
it for anything.

0003 modifies CreateCheckPoint() to insert an XLOG_CHECKPOINT_REDO
record for any non-shutdown checkpoint, and modifies
XLogInsertRecord() to treat that as a new special case, wherein after
inserting the record the redo pointer is reset while still holding the
WAL insertion locks.

I've tested this to the extent of running the regression tests, and I
also did one (1) manual test where it looked like the right thing was
happening, but that's it, so this might be buggy or perform like
garbage for all I know. But my hope is that it isn't buggy and
performs adequately. If there's any chance of getting some comments on
the basic design choices before I spend time testing and polishing it,
that would be very helpful.

Thanks,

--
Robert Haas
EDB: http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Add 'worker_type' to pg_stat_subscription
Next
From: Thomas Munro
Date:
Subject: Re: LLVM 16 (opaque pointers)