summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Haas2024-02-01 16:46:30 +0000
committerRobert Haas2024-02-01 16:52:26 +0000
commit19a829a3270fb083b3d6ae967cd3b3c02a170a38 (patch)
treebc7a24aaae69d1263a7d3cd0b8f27894a4f5733f /src
parent21912e3c0262e2cfe64856e028799d6927862563 (diff)
Continue my quest to make 002_blocks.pl pass reliably.
The latest buildfarm failures show that after the insert, we don't actually wait long enough for WAL summarization to catch up, apparently because the on disk state gets updated before the in-memory state, and so by checking the on disk state to see whether we're caught up and then the in-memory state to see where exactly how far we've progressed, we can, if unlucky, derive an older value of summarized_lsn, messing up the rest of the test. Attempt to fix this by using pg_available_wal_summaries() everywhere in the test and pg_get_wal_summarizer_state() nowhere. Per buildfarm.
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_walsummary/t/002_blocks.pl13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/bin/pg_walsummary/t/002_blocks.pl b/src/bin/pg_walsummary/t/002_blocks.pl
index c1303b188cf..d4bae3d5649 100644
--- a/src/bin/pg_walsummary/t/002_blocks.pl
+++ b/src/bin/pg_walsummary/t/002_blocks.pl
@@ -46,12 +46,11 @@ SELECT EXISTS (
EOM
ok($result, "WAL summarization caught up after insert");
-# Get a list of what summaries we now have.
-my $progress = $node1->safe_psql('postgres', <<EOM);
-SELECT summarized_tli, summarized_lsn FROM pg_get_wal_summarizer_state()
+# Find the highest LSN that is summarized on disk.
+my $summarized_lsn = $node1->safe_psql('postgres', <<EOM);
+SELECT MAX(end_lsn) AS summarized_lsn FROM pg_available_wal_summaries()
EOM
-my ($summarized_tli, $summarized_lsn) = split(/\|/, $progress);
-note("after insert, summarized TLI $summarized_tli through $summarized_lsn");
+note("after insert, summarized through $summarized_lsn");
note_wal_summary_dir("after insert", $node1);
# Update a row in the first block of the table and trigger a checkpoint.
@@ -65,7 +64,7 @@ EOM
$result = $node1->poll_query_until('postgres', <<EOM);
SELECT EXISTS (
SELECT * from pg_available_wal_summaries()
- WHERE tli = $summarized_tli AND end_lsn > '$summarized_lsn'
+ WHERE end_lsn > '$summarized_lsn'
)
EOM
ok($result, "got new WAL summary after update");
@@ -73,7 +72,7 @@ ok($result, "got new WAL summary after update");
# Figure out the exact details for the new summary file.
my $details = $node1->safe_psql('postgres', <<EOM);
SELECT tli, start_lsn, end_lsn from pg_available_wal_summaries()
- WHERE tli = $summarized_tli AND end_lsn > '$summarized_lsn'
+ WHERE end_lsn > '$summarized_lsn'
EOM
my @lines = split(/\n/, $details);
is(0+@lines, 1, "got exactly one new WAL summary");