Re: Changing the state of data checksums in a running cluster

From: Tomas Vondra <tomas(at)vondra(dot)me>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>, Bernd Helmle <mailings(at)oopsware(dot)de>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Michael Banck <mbanck(at)gmx(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Changing the state of data checksums in a running cluster
Date: 2025-08-20 17:02:57
Message-ID: c69e6245-c33d-49ea-b307-37146c9d833e@vondra.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I think there's a minor issue in how pg_checksums validates state before
checking the data.

The current patch simply does:

if (ControlFile->data_checksum_version == 0 &&
mode == PG_MODE_CHECK)
pg_fatal("data checksums are not enabled in cluster");

and that worked when the version was either 0 or 1. But now it can be
also 2 or 3, for inprogress-on / inprogress-off, and if the cluster gets
shut down at the right moment, that can end in the control file.

It doesn't make sense to verify checksums in such cluster, pg_checksums
should handle that as "off", i.e. error out.

regards

--
Tomas Vondra

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-08-20 17:07:30 Re: Organize working memory under per-PlanState context
Previous Message Tom Lane 2025-08-20 17:01:52 Re: pg_get_sequence_data Shows Non-NULL last_value for Freshly Created Sequence