On Sat, Aug 24, 2024 at 10:43 AM Thomas Munro <thomas.mu...@gmail.com> wrote: > On Sat, Aug 24, 2024 at 10:33 AM Nathan Bossart > <nathandboss...@gmail.com> wrote: > > I am seeing the exact problem described in this thread on my laptop since > > commit 490f869. I have yet to do a thorough investigation, but what I've > > seen thus far does seem to fit the subtle-differences-in-generated-WAL > > theory. If no one is planning to pick up the fix soon, I will try to. > > Sorry for dropping that. It looks like we know approximately how to > stabilise it, and I'll look at it early next week if you don't beat me > to it, but please feel free if you would like to.
It fails reliably if you nail down the initial conditions like this: $TLI = $node->safe_psql('postgres', "SELECT timeline_id FROM pg_control_checkpoint();"); +$node->safe_psql('postgres', "SELECT pg_switch_wal();"); +emit_message($node, 7956); + my $end_lsn; my $prev_lsn; The fix I propose to commit shortly is just the first of those new lines, to homogenise the initial state. See attached. The previous idea works too, I think, but this bigger hammer is more obviously removing variation.
From 9f9f16f6325fc12a83d62683503dab7a9bdfdc45 Mon Sep 17 00:00:00 2001 From: Thomas Munro <thomas.mu...@gmail.com> Date: Thu, 29 Aug 2024 17:15:24 +1200 Subject: [PATCH] Stabilize 039_end_of_wal test. The first test was sensitive to the insert LSN after setting up the catalogs, which depended on environmental things like the locales on the OS and usernames. Switch to a new WAL file before the first test, as a simple way to put every computer into the same state. Back-patch to all supported releases. Reported-by: Anton Voloshin <a.volos...@postgrespro.ru> Reported-by: Nathan Bossart <nathandboss...@gmail.com> Discussion: https://postgr.es/m/b26aeac2-cb6d-4633-a7ea-945baae83dcf%40postgrespro.ru --- src/test/recovery/t/039_end_of_wal.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/recovery/t/039_end_of_wal.pl b/src/test/recovery/t/039_end_of_wal.pl index f9acc83c7d0..8498e83f4a7 100644 --- a/src/test/recovery/t/039_end_of_wal.pl +++ b/src/test/recovery/t/039_end_of_wal.pl @@ -251,6 +251,8 @@ $WAL_BLOCK_SIZE = get_int_setting($node, 'wal_block_size'); $TLI = $node->safe_psql('postgres', "SELECT timeline_id FROM pg_control_checkpoint();"); +$node->safe_psql('postgres', "SELECT pg_switch_wal();"); + my $end_lsn; my $prev_lsn; -- 2.46.0