From: Amit Kapila Date: Thu, 18 Dec 2025 05:06:55 +0000 (+0000) Subject: Fix intermittent BF failure in 040_standby_failover_slots_sync. X-Git-Url: http://git.postgresql.org/gitweb/static/intro.html?a=commitdiff_plain;h=refs%2Fremotes%2Fgithub%2Fmaster;p=postgresql.git Fix intermittent BF failure in 040_standby_failover_slots_sync. Commit 0d2d4a0ec3 introduced a test that verifies replication slot synchronization to a standby server via SQL API. However, the test did not configure synchronized_standby_slots. Without this setting, logical failover slots can advance beyond the physical replication slot, causing intermittent synchronization failures. Author: Hou Zhijie Discussion: https://postgr.es/m/TY4PR01MB16907DF70205308BE918E0D4494ABA@TY4PR01MB16907.jpnprd01.prod.outlook.com --- diff --git a/src/test/recovery/t/040_standby_failover_slots_sync.pl b/src/test/recovery/t/040_standby_failover_slots_sync.pl index 20f942cfd14..7dadd8647e5 100644 --- a/src/test/recovery/t/040_standby_failover_slots_sync.pl +++ b/src/test/recovery/t/040_standby_failover_slots_sync.pl @@ -1080,6 +1080,14 @@ $result = $standby2->safe_psql('postgres', ); is($result, 't', "check slot sync skip count increments"); +# Configure primary to disallow any logical slots that have enabled failover +# from getting ahead of the specified physical replication slot (sb2_slot). +$primary->append_conf( + 'postgresql.conf', qq( +synchronized_standby_slots = 'sb2_slot' +)); +$primary->reload; + # Enable the Subscription, so that the remote slot catches up $subscriber1->safe_psql('postgres', "ALTER SUBSCRIPTION regress_mysub1 ENABLE"); $subscriber1->wait_for_subscription_sync;