> On 18 Aug 2026, at 06:55, Bertrand Drouvot <[email protected]> > wrote:
Thanks for reviewing!
> +# Make sure pg_control_init reports the initial disabled state
> +$result = $node->safe_psql('postgres',
> + 'SELECT data_page_checksum_version FROM pg_control_init();');
> +is($result, '0', 'ensure pg_control_init reports disabled state');
>
> This is done before the checksum state changes, when both the initial and
> current
> states are off. So it does not verify that pg_control_init() preserves the
> initial
> value after a state change.
Correct, the intention was to test the initial state.
> Worth to move it (or add one) here?
>
> "
> # Finish test suite by enabling checksums and make sure all data can be read
> # back and no processes are left over
> enable_data_checksums($node, wait => 'on');
Added a new test here to make it's still reported per the initdb state.
> Also worth checking in 004_offline.pl after,
>
> "
> # Enable checksums offline using pg_checksums
> $node->stop;
> $node->checksum_enable_offline;
> $node->start;
> "
>
> that pg_control_init() still reports the initial disabled state? That would
> also
> verify for the pg_checksums case.
Added.
I also added another test for pg_control_checkpoint in 004_offline to test the
state before and after a CHECKPOINT from offline checksum enabling.
--
Daniel Gustafsson
v6-0001-Record-initial-state-of-data-checksums-in-control.patch
Description: Binary data
v6-0002-Add-data_page_checksum_version-to-pg_control_chec.patch
Description: Binary data
