From: Michael Paquier <michael@paquier.xyz>
To: Andres Freund <andres@anarazel.de>
Cc: Greg Burd <greg@burd.me>
Cc: pgsql-hackers@postgresql.org
Cc: pgsql@j-davis.com
Cc: thomas.munro@gmail.com
Cc: exclusion@gmail.com
Cc: amit.kapila16@gmail.com
Cc: hlinnaka@iki.fi
Subject: Re: WAL record CRC calculated incorrectly because of underlying buffer modification
Date: Tue, 27 Oct 2026 08:06:48 +0900
Message-ID: <at_dCFqPVdriOCbP@paquier.xyz> (raw)
In-Reply-To: <o564wjvhkq7o7jl7fwbst5dw5rowekcfizmbp4odstjvoh5vve@6jt34ntyeca4>
References: <ats4pi-RM0Uom0T9@floki>
<at7GY97qm-zGyanz@paquier.xyz>
<o564wjvhkq7o7jl7fwbst5dw5rowekcfizmbp4odstjvoh5vve@6jt34ntyeca4>
On Mon, Oct 26, 2026 at 09:46:18AM -0400, Andres Freund wrote:
> I frankly think it's pretty much unacceptable for a niche index like hash to
> violate the rules like that. If it were btree, it'd perhaps be worthwhile to
> add generic infrastructure for this, but here it doesn't seem like the juice
> is worth the squeeze.
I'm definitely not convinced that hash is a sufficient argument for
having more infrastructure. What this is telling us here is the
contrary: we should have less infrastructure. So I'd love to be able
to put REGBUF_NO_CHANGE in the garbage bin and have an assert in the
replay code instead of silently ignoring a case.
> I'm not really convinced by that argument. It's probably the best answer in
> the back branches, but I think we shouldn't do this in master.
I'm not sure that I can side with your argument here. Doing nothing
on master means that we're still open to the CRC problem until we
decide to fix hash, so it still looks like a problem that needs to be
tackled in three steps:
- Avoid the CRC problem down to v17, including HEAD.
- Address hash to avoid the rule breakage.
- Lift the check in replay for wal_consistency_checking (re-add the
assert) and push REGBUF_NO_CHANGE into orbit.
There is nothing more permanent than a temporary fix, as some say,
but I'd like to trust in something happening for hash. I'm not
planning to code that myself, though, but if somebody is willing to
work that, be it with an LLM, I would read the code.
That's just to say that I don't see a downside with including HEAD in
step 1.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: michael@paquier.xyz, andres@anarazel.de, greg@burd.me, pgsql@j-davis.com, thomas.munro@gmail.com, exclusion@gmail.com, amit.kapila16@gmail.com, hlinnaka@iki.fi
Subject: Re: WAL record CRC calculated incorrectly because of underlying buffer modification
In-Reply-To: <at_dCFqPVdriOCbP@paquier.xyz>
References: <ats4pi-RM0Uom0T9@floki> <at7GY97qm-zGyanz@paquier.xyz> <o564wjvhkq7o7jl7fwbst5dw5rowekcfizmbp4odstjvoh5vve@6jt34ntyeca4> <at_dCFqPVdriOCbP@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox