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

Commitae395f0

Browse files
author
Amit Kapila
committed
Fix the testcase introduced in commit81d20fb.
The failed test was syncing failover replication slot to standby to testthat we remove such slots after the standby is converted to subscriber bypg_createsubscriber.In one of the buildfarm members, the sync of the slot failed because theLSN on the standby was before the syncslot's LSN. We need to wait forstandby to catch up before trying to sync the slot withpg_sync_replication_slots().The other buildfarm failed because autovacuum generated a xid which isreplicated to the standby at some random point making slots at primarylag behind standby during slot sync.Both these failures wouldn't have occurred if we had used built-inslotsync worker as it would have waited for the standby to sync withprimary but for this test, it is sufficient to usepg_sync_replication_slots().Reported-by: Alexander Lakhin as per buildfarmAuthor: Kuroda HayatoReviewed-by: Amit KapilaBackpatch-through: 17Discussion:https://postgr.es/m/0dffca12-bf17-4a7a-334d-225569de5e6e@gmail.comDiscussion:https://postgr.es/m/OSBPR01MB25528300C71FDD83EA1DCA12F5DD2@OSBPR01MB2552.jpnprd01.prod.outlook.com
1 parent9fd0252 commitae395f0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎src/bin/pg_basebackup/t/040_pg_createsubscriber.pl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ sub generate_db
116116
my$node_p = PostgreSQL::Test::Cluster->new('node_p');
117117
my$pconnstr =$node_p->connstr;
118118
$node_p->init(allows_streaming=>'logical');
119+
# Disable autovacuum to avoid generating xid during stats update as otherwise
120+
# the new XID could then be replicated to standby at some random point making
121+
# slots at primary lag behind standby during slot sync.
122+
$node_p->append_conf('postgresql.conf','autovacuum = off');
119123
$node_p->start;
120124

121125
# Set up node F as about-to-fail node
@@ -293,6 +297,9 @@ sub generate_db
293297
"SELECT pg_create_logical_replication_slot('$fslotname', 'pgoutput', false, false, true)"
294298
);
295299
$node_s->start;
300+
# Wait for the standby to catch up so that the standby is not lagging behind
301+
# the failover slot.
302+
$node_p->wait_for_replay_catchup($node_s);
296303
$node_s->safe_psql('postgres',"SELECT pg_sync_replication_slots()");
297304
my$result =$node_s->safe_psql('postgres',
298305
"SELECT slot_name FROM pg_replication_slots WHERE slot_name = '$fslotname' AND synced AND NOT temporary"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp