1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-19 17:02:53 +03:00

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 <houzj.fnst@fujitsu.com>
Discussion: https://postgr.es/m/TY4PR01MB16907DF70205308BE918E0D4494ABA@TY4PR01MB16907.jpnprd01.prod.outlook.com
This commit is contained in:
Amit Kapila
2025-12-18 05:06:55 +00:00
parent 5cf03552fb
commit b47c50e566

View File

@@ -1080,6 +1080,14 @@ $result = $standby2->safe_psql('postgres',
); );
is($result, 't', "check slot sync skip count increments"); 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 # Enable the Subscription, so that the remote slot catches up
$subscriber1->safe_psql('postgres', "ALTER SUBSCRIPTION regress_mysub1 ENABLE"); $subscriber1->safe_psql('postgres', "ALTER SUBSCRIPTION regress_mysub1 ENABLE");
$subscriber1->wait_for_subscription_sync; $subscriber1->wait_for_subscription_sync;