Re: Re: Offline data checksum changes can cause incorrect checksum state on standbys
Re: Re: Offline data checksum changes can cause incorrect checksum state on standbys
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
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 <daniel@yesql.se> 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