Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9bc1eee

Browse files
author
Amit Kapila
committed
Another try to fix BF failure introduced in commit ddd5f4f.
Before attempting to sync the slot on standby by pg_sync_replication_slots(), ensure that on the primary restart_lsn for the slot has moved to a recent WAL position, by re-creating the subscription and the logical slot. Author: Hou Zhijie Discussion: https://postgr.es/m/CAA4eK1+d5Lne8vCAn0un4SP9x-ZBr2-xfxg01uSfeBTSCKFZoQ@mail.gmail.com
1 parent 0c444a7 commit 9bc1eee

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/test/recovery/t/040_standby_failover_slots_sync.pl

+7-10
Original file line numberDiff line numberDiff line change
@@ -223,17 +223,14 @@
223223
$standby1->append_conf('postgresql.conf', 'max_slot_wal_keep_size = -1');
224224
$standby1->reload;
225225

226-
# Enable the subscription to let it catch up to the latest wal position
227-
$subscriber1->safe_psql('postgres',
228-
"ALTER SUBSCRIPTION regress_mysub1 ENABLE");
226+
# To ensure that restart_lsn has moved to a recent WAL position, we re-create
227+
# the subscription and the logical slot.
228+
$subscriber1->safe_psql(
229+
'postgres', qq[
230+
DROP SUBSCRIPTION regress_mysub1;
231+
CREATE SUBSCRIPTION regress_mysub1 CONNECTION '$publisher_connstr' PUBLICATION regress_mypub WITH (slot_name = lsub1_slot, copy_data = false, failover = true);
232+
]);
229233

230-
# This wait ensures that confirmed_flush_lsn has been moved to latest
231-
# position.
232-
$primary->wait_for_catchup('regress_mysub1');
233-
234-
# To ensure that restart_lsn has moved to a recent WAL position, we need
235-
# to log XLOG_RUNNING_XACTS and make sure the same is processed as well
236-
$primary->psql('postgres', "CHECKPOINT");
237234
$primary->wait_for_catchup('regress_mysub1');
238235

239236
# Do not allow any further advancement of the restart_lsn for the lsub1_slot.

0 commit comments

Comments
 (0)