> On 18 Sep 2026, at 12:26, Nazir Bilal Yavuz <[email protected]> wrote:

> I encountered two problems with the test_checksums/013_rewind test:
> ...
> I spent some time fixing these problems with the help of an LLM.

Thanks!

> Problem #1:
> 
> We wait for the primary's insert LSN in three places, but the primary
> might be idle and not have sent it yet:

Makes sense.

-$node_a->wait_for_catchup($node_b, 'replay', $node_a->lsn('insert'));
+# Backup completion has flushed the required WAL.
+$node_a->wait_for_catchup($node_b, 'replay', $node_a->lsn('flush'));

In these cases, couldn't we just wait for the replay LSN, ie the default for
wait_for_catchup?

> Problem #2
> 
> ($stdout, $stderr) = run_command(
> [
> 'pg_waldump',
> '-p' => $node_a->data_dir . '/pg_wal',
> '-t' => 1,
> '-s' => $shutdown_ckpt,
> '-n' => 1,
> ]);
> like($stdout, qr/CHECKPOINT_SHUTDOWN/,
> 'last common checkpoint is a shutdown checkpoint');
> 
> We don't specifiy which WAL file that pg_waldump() will use, then
> pg_waldump select first WAL data available in the directory. Then, it
> might select a WAL file whose header is not initialized yet (a
> preallocated WAL file).

Nice find, this patch seems quite straightforward.

--
Daniel Gustafsson



Reply via email to