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

Commit28ed5ec

Browse files
Stabilize subscription stats test.
The new test added by commit68a59f9 disables the subscription andmanually drops the associated replication slot. However, sincedisabling the subsubscription doesn't wait for a walsender to releasethe replication slot and exit, pg_drop_replication_slot() couldfail. Avoid failure by adding a wait for the replication slot tobecome inactive.Reported-by: Hou Zhijie, as per buildfarmReviewed-by: Hou ZhijieDiscussion:https://postgr.es/m/OS0PR01MB571682316378379AA34854F694E9A%40OS0PR01MB5716.jpnprd01.prod.outlook.comBackpatch-through: 15
1 parent5a3423a commit28ed5ec

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎src/test/subscription/t/026_stats.pl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,14 @@ sub create_sub_pub_w_errors
285285
$db,qq(SELECT pg_stat_have_stats('subscription', 0,$sub2_oid))),
286286
qq(f),
287287
qq(Subscription stats for subscription '$sub2_name' should be removed.));
288+
289+
# Since disabling subscription doesn't wait for walsender to release the replication
290+
# slot and exit, wait for the slot to become inactive.
291+
$node_publisher->poll_query_until(
292+
$db,
293+
qq(SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = '$sub2_name' AND active_pid IS NULL))
294+
)ordie"slot never became inactive";
295+
288296
$node_publisher->safe_psql($db,
289297
qq(SELECT pg_drop_replication_slot('$sub2_name')));
290298

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp