On Sun, Nov 22, 2026 at 12:35 AM shihao zhong <[email protected]> wrote: > An incremental backup taken while checksums are still > being enabled online also gets refused, though the restored cluster > just comes up with checksums off. The comment in check_control_files() > says we only check when the last backup has checksums on, so I think > the test should be "== PG_DATA_CHECKSUM_VERSION" instead of "!= OFF".
Thanks, you're right. I tested it with an incremental backup taken while the state was inprogress-on. With your change pg_combinebackup accepts the chain, and the restored cluster logs "enabling data checksums was interrupted" and comes up with checksums off, with all rows readable. I also checked the other way recovery can end. When the archive has WAL past the point where enabling finished, recovery replays the rest of it and the restored cluster ends with checksums on. pg_checksums --check then finds no bad blocks, because the worker writes every page with a full-page image. The same change also accepts a final backup taken while checksums were being disabled, which is safe for the same reason. v2 attached: 0001 is v1 unchanged (hint and docs). 0002 makes your change, adds a sentence to the docs, and adds a case to test_checksums/024_combinebackup_mixed.pl for a final backup taken during an online enable. The new case fails without the code change. While running it I hit a race: the first restored node in that test can archive a timeline 2 history file into the shared archive, and the second restored node then tries to follow a timeline that branched before its backup. The new node now sets recovery_target_timeline = 'current'. I credited you with Suggested-by in 0002. Regards, Sai Pranav
v2-0001-pg_combinebackup-Don-t-point-only-to-pg_checksums.patch
Description: Binary data
v2-0002-pg_combinebackup-Accept-a-final-backup-taken-duri.patch
Description: Binary data
