Re: Non-replayable WAL records through overflows and >MaxAllocSize lengths
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Michael Paquier <michael@paquier.xyz>
Cc: Ian Lawrence Barwick <barwick@gmail.com>, Matthias van de Meent <boekewurm+postgres@gmail.com>, Heikki Linnakangas <hlinnaka@iki.fi>, David Zhang <david.zhang@highgo.ca>, Robert Haas <robertmhaas@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2022-12-02T16:57:17Z
Lists: pgsql-hackers
Hi, On 2022-12-02 14:22:55 +0900, Michael Paquier wrote: > On Fri, Nov 04, 2022 at 09:52:39AM +0900, Ian Lawrence Barwick wrote: > > CommitFest 2022-11 is currently underway, so if you are interested > > in moving this patch forward, now would be a good time to update it. > > No replies after 4 weeks, so I have marked this entry as returned > with feedback. I am still wondering what would be the best thing to > do here.. IMO this a bugfix, I don't think we can just close the entry, even if Matthias doesn't have time / energy to push it forward. I think the big issue with the patch as it stands is that it will typically cause PANICs on failure, because the record-too-large ERROR be a in a critical section. That's still better than generating a record that can't be replayed, but it's not good. There's not all that many places with potentially huge records. I wonder if we ought to modify at least the most prominent ones to prepare the record before the critical section. I think the by far most prominent real-world case is RecordTransactionCommit(). I think we could rename XactLogCommitRecord() to XactBuildCommitRecord() build the commit record, then have the caller do START_CRIT_SECTION(), set DELAY_CHKPT_START, and only then do the XLogInsert(). That'd even have the nice side-effect of reducing the window in which DELAY_CHKPT_START is set a bit. Greetings, Andres Freund
Commits
-
Add more protections in WAL record APIs against overflows
- 8fcb32db98ed 16.0 landed
-
Add overflow protection for block-related data in WAL records
- ffd1b6bb6f8a 16.0 landed
-
Change internal RelFileNode references to RelFileNumber or RelFileLocator.
- b0a55e43299c 16.0 cited
-
Revamp the WAL record format.
- 2c03216d8311 9.5.0 cited