<div> </div><div> </div><div>27.08.2026, 16:17, "Andrey Borodin" <x4mmm(at)yandex-team(dot)ru>:</div><div>> It seems to me that 002_archiving.pl has a race. Generating and<br />> archiving WAL on timeline 2 does not guarantee that standby2 replays it<br />> before promotion. It can still be promoted while lastRecTLI is 1, so<br />> the test would not prove that the restored timeline 2 history was used.<br />> I think it needs to wait for the recorded timeline_2_lsn before calling<br />> promote(), for example:<br />><br />> $caughtup_query =<br />> "SELECT '$timeline_2_lsn'::pg_lsn <= pg_last_wal_replay_lsn()";<br />> $node_standby2->poll_query_until('postgres', $caughtup_query)<br />> or die "Timed out while waiting for standby2 to reach timeline 2";</div><div> </div><div>Hi, Andrey!<br /> </div><div>Thank you for the review. You are right, there is a race.</div><div> </div><div>In v2 i added suggested query to wait timeline_2_lsn. This will help<br />to avoid promotion before timeline2 is applied.</div><div> </div><div>Thank you!<br /><br />Best regards, Stepan Filippov.<br /> </div>