Avoid error in recovery test if history file is not yet present
authorAndrew Dunstan <[email protected]>
Wed, 17 Jul 2024 14:35:50 +0000 (10:35 -0400)
committerAndrew Dunstan <[email protected]>
Wed, 17 Jul 2024 14:43:07 +0000 (10:43 -0400)
Error was detected when testing use of libpq sessions instead of psql
for polling queries.

Discussion: https://postgr.es/m/e86b6d2d-20d8-4ac9-9a98-165fff7db886@dunslane.net

Backpatch to all live branches

src/test/recovery/t/002_archiving.pl

index 4d784bdf554a757290bd67e8d9a22755beb04f0b..96011b5ee6e3085556b42f99db87d0ca2182597f 100644 (file)
@@ -67,7 +67,7 @@ $node_standby->promote;
 # creating a RECOVERYHISTORY.
 my $primary_archive = $node_master->archive_dir;
 $caughtup_query =
-  "SELECT size IS NOT NULL FROM pg_stat_file('$primary_archive/00000002.history')";
+  "SELECT size IS NOT NULL FROM pg_stat_file('$primary_archive/00000002.history', true)";
 $node_master->poll_query_until('postgres', $caughtup_query)
   or die "Timed out while waiting for archiving of 00000002.history";