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

Commitbd8fc16

Browse files
author
Amit Kapila
committed
Fix BF introduced in commitddd5f4f.
The failure is that the remote slot is not synchronized after the sameslot on standby gets invalidated. The reason was that remote_slot'srestart_lsn was lagged behind the standby's oldest WAL segment. The testdidn't ensure that remote_slot's LSN was advanced to the latest positionbefore we tried to sync the slots via new the functionpg_sync_replication_slots().Discussion:https://postgr.es/m/CAA4eK1JLBi3HzenB6do3_hd78kN0UDD1mz-vumWE52XHHEq5Bw@mail.gmail.com
1 parentb8f9e77 commitbd8fc16

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
# flagged as 'synced'
172172
is($standby1->safe_psql(
173173
'postgres',
174-
q{SELECT count(*) = 2 FROM pg_replication_slots WHERE slot_name IN ('lsub1_slot', 'lsub2_slot') AND synced;}
174+
q{SELECT count(*) = 2 FROM pg_replication_slots WHERE slot_name IN ('lsub1_slot', 'lsub2_slot') AND synced AND NOT temporary;}
175175
),
176176
"t",
177177
'logical slots have synced as true on standby');
@@ -227,6 +227,13 @@
227227
$subscriber1->safe_psql('postgres',
228228
"ALTER SUBSCRIPTION regress_mysub1 ENABLE");
229229

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");
230237
$primary->wait_for_catchup('regress_mysub1');
231238

232239
# Do not allow any further advancement of the restart_lsn for the lsub1_slot.
@@ -256,7 +263,7 @@
256263
# flagged as 'synced'
257264
is($standby1->safe_psql(
258265
'postgres',
259-
q{SELECT conflict_reason IS NULL AND synced FROM pg_replication_slots WHERE slot_name = 'lsub1_slot';}
266+
q{SELECT conflict_reason IS NULL AND syncedAND NOT temporaryFROM pg_replication_slots WHERE slot_name = 'lsub1_slot';}
260267
),
261268
"t",
262269
'logical slot is re-synced');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp