agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_checksums: Refuse interrupted transitions, note change is loc
Date: Mon, 14 Sep 2026 13:34:14 +0000
Message-ID: <E1x66p4-00000000I6J-2M6g@gemulon.postgresql.org> (raw)

pg_checksums: Refuse interrupted transitions, note change is local

An inprogress-on or inprogress-off control file means an online
transition was cut short, running the offline tool on top of it mixes
two procedures.  Refuse it in every mode, with a hint pointing at the
start-stop cycle (or, on a standby, at letting replication finish)
that resets the state.  Also print that the change applies to one
data directory only, with standby-aware wording, since in a
replication setup the same change must be made on every node.

On a primary, inprogress-on cannot survive a graceful stop: the
checksums launcher resolves it from its exit cleanup, and a crashed
primary is already rejected by the existing "cluster must be shut
down" check.  inprogress-off can, however, it is set by the backend
running pg_disable_data_checksums(), and a fast shutdown arriving
between its two barriers leaves it behind in a cleanly shut down
control file, where the next start-stop cycle resolves it at end of
recovery.  A standby can be stopped with either state, since it has
no launcher and only carries forward whatever state the last replayed
WAL record left it in, with a restartpoint persisting that as-is.
The standby is also the deterministic way to reach the new guard,
which is why the test coverage uses one; the primary window would
need an injection point between the two barriers.

The pg_checksums page said the tool still processes all relation files
regardless of an interrupted online transition; describe the refusal
instead.

Author: Zsolt Parragi <zsolt.parragi@percona.com>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://postgr.es/m/anwm6UPxoVS41QA2@bdtpg
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3e70c527cc399e3d7f569f6d01b6601f20b82255

Modified Files
--------------
doc/src/sgml/ref/pg_checksums.sgml                 | 11 ++++----
src/bin/pg_checksums/pg_checksums.c                | 21 ++++++++++++++++
.../test_checksums/t/012_offline_standby.pl        | 29 +++++++++++++++++-----
3 files changed, 50 insertions(+), 11 deletions(-)



Message-ID: <E1x66p4-00000000I6J-2M6g@gemulon.postgresql.org>
Permalink:  ../E1x66p4-00000000I6J-2M6g@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1x66p4-00000000I6J-2M6g@gemulon.postgresql.org

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: dgustafsson@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: pg_checksums: Refuse interrupted transitions, note change is loc
  In-Reply-To: <E1x66p4-00000000I6J-2M6g@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox