From: Alexander Lakhin <exclusion@gmail.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Subject: Re: WAL record CRC calculated incorrectly because of underlying buffer modification
Date: Sat, 11 May 2024 08:00:00 +0300
Message-ID: <35e2c2f8-f65a-f93a-ea23-957bb67a2d42@gmail.com> (raw)
In-Reply-To: <CA+hUKGJEtb65B+v2Vk25WbvvALH5DxL5Oye=DuhCVP8K1X3Obg@mail.gmail.com>
References: <055bb33c-bccc-bc1d-c2f8-8598534448ac@gmail.com>
<20240510155742.sznwmnmllsewjsbc@awork3.anarazel.de>
<CA+hUKGKmi5VhDAq1O2gU55Qy_zQymSfF73nCaC9HBjnA50qdHQ@mail.gmail.com>
<0a2e14d3-fbc8-9e86-a968-e0c4a465e5b0@gmail.com>
<CA+hUKGJEtb65B+v2Vk25WbvvALH5DxL5Oye=DuhCVP8K1X3Obg@mail.gmail.com>
11.05.2024 07:25, Thomas Munro wrote:
> On Sat, May 11, 2024 at 4:00 PM Alexander Lakhin <exclusion@gmail.com> wrote:
>> 11.05.2024 06:26, Thomas Munro wrote:
>>> Perhaps a no-image, no-change registered buffer should not be
>>> including an image, even for XLR_CHECK_CONSISTENCY? It's actually
>>> useless for consistency checking too I guess, this issue aside,
>>> because it doesn't change anything so there is nothing to check.
>> Yes, I think something wrong is here. I've reduced the reproducer to:
> Does it reproduce if you do this?
>
> - include_image = needs_backup || (info &
> XLR_CHECK_CONSISTENCY) != 0;
> + include_image = needs_backup ||
> + ((info & XLR_CHECK_CONSISTENCY) != 0 &&
> + (regbuf->flags & REGBUF_NO_CHANGE) == 0);
No, it doesn't (at least with the latter, more targeted reproducer).
> Unfortunately the back branches don't have that new flag from 00d7fb5e
> so, even if this is the right direction (not sure, I don't understand
> this clean registered buffer trick) then ... but wait, why are there
> are no failures like this in the back branches (yet at least)? Does
> your reproducer work for 16? I wonder if something relevant changed
> recently, like f56a9def. CC'ing Michael and Amit K for info.
Maybe it's hard to hit (autovacuum needs to process the index page in a
narrow time frame), but locally I could reproduce the issue even on
ac27c74de(~1 too) from 2018-09-06 (I tried several last commits touching
hash indexes, didn't dig deeper).
Best regards,
Alexander
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: exclusion@gmail.com, thomas.munro@gmail.com, andres@anarazel.de, michael@paquier.xyz, amit.kapila16@gmail.com
Subject: Re: WAL record CRC calculated incorrectly because of underlying buffer modification
In-Reply-To: <35e2c2f8-f65a-f93a-ea23-957bb67a2d42@gmail.com>
References: <055bb33c-bccc-bc1d-c2f8-8598534448ac@gmail.com> <20240510155742.sznwmnmllsewjsbc@awork3.anarazel.de> <CA+hUKGKmi5VhDAq1O2gU55Qy_zQymSfF73nCaC9HBjnA50qdHQ@mail.gmail.com> <0a2e14d3-fbc8-9e86-a968-e0c4a465e5b0@gmail.com> <CA+hUKGJEtb65B+v2Vk25WbvvALH5DxL5Oye=DuhCVP8K1X3Obg@mail.gmail.com> <35e2c2f8-f65a-f93a-ea23-957bb67a2d42@gmail.com>
* 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