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

Commitdf33561

Browse files
author
Amit Kapila
committed
Fix cfbot failure caused by commit228c370.
Ensure the test waits for the apply worker to exit after disabling thesubscription. This is necessary to safely enable the retain_dead_tuplesoption. Also added a similar wait in another part of the test to preventunintended apply worker activity that could lead to test failurespost-subscription disable.Reported by Michael Paquier as per cfbot.Author: Zhijie Hou <houzj.fnst@fujitsu.com>Discussion:https://postgr.es/m/aIGLgfRJIBwExoPj@paquier.xyz
1 parent086b9a3 commitdf33561

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎src/test/subscription/t/035_conflicts.pl‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@
228228
# Disable the subscription
229229
$node_A->psql('postgres',"ALTER SUBSCRIPTION$subname_AB DISABLE;");
230230

231+
# Wait for the apply worker to stop
232+
$node_A->poll_query_until('postgres',
233+
"SELECT count(*) = 0 FROM pg_stat_activity WHERE backend_type = 'logical replication apply worker'"
234+
);
235+
231236
# Enable retain_dead_tuples for disabled subscription
232237
($cmdret,$stdout,$stderr) =$node_A->psql('postgres',
233238
"ALTER SUBSCRIPTION$subname_AB SET (retain_dead_tuples = true);");
@@ -278,6 +283,11 @@
278283
# Disable the logical replication from node B to node A
279284
$node_A->safe_psql('postgres',"ALTER SUBSCRIPTION$subname_AB DISABLE");
280285

286+
# Wait for the apply worker to stop
287+
$node_A->poll_query_until('postgres',
288+
"SELECT count(*) = 0 FROM pg_stat_activity WHERE backend_type = 'logical replication apply worker'"
289+
);
290+
281291
$node_B->safe_psql('postgres',"UPDATE tab SET b = 3 WHERE a = 1;");
282292
$node_A->safe_psql('postgres',"DELETE FROM tab WHERE a = 1;");
283293

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp