Move WAL/RMGR sequence code into its own file and header

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Move WAL/RMGR sequence code into its own file and header
Date: 2025-11-27 04:29:56
Message-ID: aSfTxIWjiXkTKh1E@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

Something that has been bugging me in the sequence code, while doing
some recent work (cough), is the fact that it is possible to cleanly
split the RMGR sequence code from the main sequence.c.

Please find attached a patch doing that, cleaning a bit sequence.c by
removing some of the WAL bits in it, as of:
- Addition of a new file sequence_xlog.c.
- Addition of a new header, sequence_xlog.h.

SEQ_MAGIC and sequence_magic need to be moved from sequence.c to the
new sequence_xlog.h, separating the WAL insert code with the backend
redo parts of it, which is more consistent with other RMGRs.

I have been looking at some other parts of the backend (like the
tablespace part), but these don't really bring a clear gain like the
change in the attached does.

Thanks,
--
Michael

Attachment Content-Type Size
0001-Move-WAL-sequence-code-into-its-own-file.patch text/x-diff 11.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2025-11-27 05:12:05 Re: How can end users know the cause of LR slot sync delays?
Previous Message Michael Paquier 2025-11-27 04:17:11 Re: Add pg_buffercache_mark_dirty[_all] functions to the pg_buffercache