Hi Daniel, A small follow-up to 724477d67e2 (pg_combinebackup: Refuse mixed data checksum states in a backup chain).
The refusal also fires when checksums were enabled online, and then the hint points to a tool the user never ran: initdb --no-data-checksums, summarize_wal = on full backup SELECT pg_enable_data_checksums(); -- wait for "on" incremental backup pg_combinebackup full incr pg_combinebackup: error: only some backups have checksums enabled pg_combinebackup: hint: Take a new full backup after changing the data checksum state with pg_checksums. The same happens for a full backup taken while checksums were still being enabled (its control file has data checksum version 3) followed by an incremental taken after they reached "on". The attached patch drops "with pg_checksums" from the hint, and changes the Limitations paragraph in the pg_combinebackup docs to cover both ways of enabling checksums and the in-progress case. pg_combinebackup's tests and test_checksums' 024_combinebackup_mixed (PG_TEST_EXTRA=checksum) pass, and the docs validate. One related observation, not addressed by the patch: after an online enable the refusal is stricter than it needs to be. The worker writes every page with log_newpage_buffer(), so the WAL summaries cover every block, and in my test the incremental backup taken afterwards contained no INCREMENTAL files at all: every relation file was sent in full, so nothing in the combined directory would have come from the backup taken before checksums were on. I don't think pg_combinebackup can tell an online enable from an offline one with what is in the control files, so refusing both seems like the safe choice; I mention it only in case the docs should say so. Regards, Sai Pranav On Tue, Nov 03, 2026 08:46 PM, Daniel Gustafsson <[email protected]> wrote: > Pushed to master along with the cleanups from the "Trying to break online > checksums with LLMs" thread. Not backpatched yet, as I wanted a few > builds in > the BF first and also some input on the new open item in the other thread. > > -- > Daniel Gustafsson > > > > > >
From 5f7a56f65efe8c94ed64e1dbd07a464d2c920c9b Mon Sep 17 00:00:00 2001 From: Sai Pranav <[email protected]> Date: Tue, 3 Nov 2026 19:15:16 +0530 Subject: [PATCH v1] pg_combinebackup: Don't point only to pg_checksums for mixed checksum states When pg_combinebackup refuses a backup chain whose backups were taken under different data checksum states, its hint and the Limitations section of its documentation tell the user to take a new full backup after enabling checksums with pg_checksums. Since checksums can also be enabled online with pg_enable_data_checksums(), the same refusal happens when they were enabled that way, or when an earlier backup was taken while they were still being enabled, and the hint then names a tool the user never ran. Drop the reference to pg_checksums from the hint, and describe both ways of enabling checksums in the documentation, along with the case of a backup taken while checksums were being enabled. --- doc/src/sgml/ref/pg_combinebackup.sgml | 14 ++++++++------ src/bin/pg_combinebackup/pg_combinebackup.c | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/src/sgml/ref/pg_combinebackup.sgml b/doc/src/sgml/ref/pg_combinebackup.sgml index f5d7e177b36..c300a617cd6 100644 --- a/doc/src/sgml/ref/pg_combinebackup.sgml +++ b/doc/src/sgml/ref/pg_combinebackup.sgml @@ -306,13 +306,15 @@ PostgreSQL documentation <para> <literal>pg_combinebackup</literal> does not recompute page checksums when - writing the output directory. It therefore refuses a chain in which some - of the backups used for reconstruction were taken with checksums disabled - but the final backup was taken with checksums enabled: the resulting - directory would contain pages with invalid checksums, and the cluster + writing the output directory. It therefore refuses a chain in which the + final backup was taken with checksums enabled but some of the backups used + for reconstruction were not, because they were taken before checksums + were enabled or while they were still being enabled: the resulting + directory could contain pages with invalid checksums, and the cluster would fail checksum verification as soon as it reads them. Take a new - full backup after enabling data checksums with - <xref linkend="app-pgchecksums"/>. + full backup once data checksums have been enabled, whether offline with + <xref linkend="app-pgchecksums"/> or online (see + <xref linkend="checksums-online-enable-disable"/>). </para> <para> diff --git a/src/bin/pg_combinebackup/pg_combinebackup.c b/src/bin/pg_combinebackup/pg_combinebackup.c index 254a27b125b..589b5c8e795 100644 --- a/src/bin/pg_combinebackup/pg_combinebackup.c +++ b/src/bin/pg_combinebackup/pg_combinebackup.c @@ -681,7 +681,7 @@ check_control_files(int n_backups, char **backup_dirs) if (data_checksum_mismatch) { pg_log_error("only some backups have checksums enabled"); - pg_log_error_hint("Take a new full backup after changing the data checksum state with pg_checksums."); + pg_log_error_hint("Take a new full backup after changing the data checksum state."); exit(1); } -- 2.50.1 (Apple Git-155)
