Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9bc1eee

Browse files
author
Amit Kapila
committed
Another try to fix BF failure introduced in commitddd5f4f.
Before attempting to sync the slot on standby bypg_sync_replication_slots(), ensure that on the primary restart_lsn forthe slot has moved to a recent WAL position, by re-creating thesubscription and the logical slot.Author: Hou ZhijieDiscussion:https://postgr.es/m/CAA4eK1+d5Lne8vCAn0un4SP9x-ZBr2-xfxg01uSfeBTSCKFZoQ@mail.gmail.com
1 parent0c444a7 commit9bc1eee

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

Lines changed: 7 additions & 10 deletions
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)

[8]ページ先頭

©2009-2025 Movatter.jp