Re: basebackup: do not verify checksums on pages written before enabling checksums

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: basebackup: do not verify checksums on pages written before enabling checksums
Date: 2026-08-17 13:52:49
Message-ID: aoMSMUUcNXJH4Djv@bdtpg
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Mon, Aug 17, 2026 at 03:15:43PM +0200, Daniel Gustafsson wrote:
> > On 17 Aug 2026, at 14:54, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
>
> > +$node->stop;
> > +$node->corrupt_page_checksum($fcorrupt, 0);
> > +$node->start;
> >
> > The test stops and restarts the node before taking the backup, which resets
> > lastChecksumChangeRecPtr.
> >
> > Should we also test that verification resumes while lastChecksumChangeRecPtr is
> > still set?
>
> corrupt_page_checksum() only works reliably when the cluster is turned off,

Oh right, Doh, I missed that.

> a
> reliable corrupt-checksum mechanism for an online cluster could for sure be
> done but seems a bit more invasive at this point.

Yeah. Maybe one option could be to add an injection point in verify_page_checksum(),
just after:

if (!backup_checksums_verifiable(start_lsn))
return true;

and before pg_checksum_page(), then attach an "error" action for the post transition
backup? That would cover verification resuming while lastChecksumChangeRecPtr is
still set, if we think it is worth testing.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2026-08-17 13:53:26 Re: Reduce WAL volume for heap tuple hint bits
Previous Message Peter Eisentraut 2026-08-17 13:52:27 macOS + gcc + meson + --werror is broken