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

Commit4d26d93

Browse files
author
Amit Kapila
committed
Improve one of the test cases in 035_standby_logical_decoding.pl.
The test to ensure that decoding changes via logical slot from anotherdatabase will fail was incorrectly done on the primary node instead of onthe standby node.In the passing, make the test to wait for replay catchup by usingwait_for_replay_catchup(). This will make it consistent with the way wewait at other places in the test.Author: Shi yuReviewed-by: Bertrand Drouvot, Amit KapilaDiscussion:https://postgr.es/m/OSZPR01MB6310B0A507A0F2A2D379F38CFD6A9@OSZPR01MB6310.jpnprd01.prod.outlook.com
1 parentb726236 commit4d26d93

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

‎src/test/recovery/t/035_standby_logical_decoding.pl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ sub check_for_invalidation
361361
qq[INSERT INTO decoding_test(x,y) SELECT s, s::text FROM generate_series(5,50) s;]
362362
);
363363

364-
$node_primary->wait_for_catchup($node_standby);
364+
$node_primary->wait_for_replay_catchup($node_standby);
365365

366366
my$stdout_recv =$node_standby->pg_recvlogical_upto(
367367
'testdb','behaves_ok_activeslot',$endpos,$default_timeout,
@@ -384,12 +384,17 @@ sub check_for_invalidation
384384

385385
$node_primary->safe_psql('postgres','CREATE DATABASE otherdb');
386386

387-
is($node_primary->psql(
387+
# Wait for catchup to ensure that the new database is visible to other sessions
388+
# on the standby.
389+
$node_primary->wait_for_replay_catchup($node_standby);
390+
391+
($result,$stdout,$stderr) =$node_standby->psql(
388392
'otherdb',
389393
"SELECT lsn FROM pg_logical_slot_peek_changes('behaves_ok_activeslot', NULL, NULL) ORDER BY lsn DESC LIMIT 1;"
390-
),
391-
3,
392-
'replaying logical slot from another database fails');
394+
);
395+
ok($stderr =~
396+
m/replication slot "behaves_ok_activeslot" was not created in this database/,
397+
"replaying logical slot from another database fails");
393398

394399
##################################################
395400
# Test that we can subscribe on the standby with the publication

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp