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

Commite5a9bcb

Browse files
committed
Use pg_ctl promote -w in TAP tests
Switch TAP tests to use the new wait mode of pg_ctl promote. Thisallows avoiding extra logic with poll_query_until() to be sure that apromoted standby is ready for read-write queries.From: Michael Paquier <michael.paquier@gmail.com>
1 parent5d58c07 commite5a9bcb

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

‎src/bin/pg_rewind/RewindTest.pm

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,8 @@ sub promote_standby
161161
ordie"Timed out while waiting for standby to receive and write WAL";
162162

163163
# Now promote slave and insert some new data on master, this will put
164-
# the master out-of-sync with the standby. Wait until the standby is
165-
# out of recovery mode, and is ready to accept read-write connections.
164+
# the master out-of-sync with the standby.
166165
$node_standby->promote;
167-
$node_standby->poll_query_until('postgres',
168-
"SELECT NOT pg_is_in_recovery()")
169-
ordie"Timed out while waiting for promotion of standby";
170166

171167
# Force a checkpoint after the promotion. pg_rewind looks at the control
172168
# file to determine what timeline the server is on, and that isn't updated

‎src/test/perl/PostgresNode.pm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ sub restart
723723
724724
=item$node->promote()
725725
726-
Wrapper for pg_ctl promote
726+
Wrapper for pg_ctl promote -w
727727
728728
=cut
729729

@@ -735,7 +735,8 @@ sub promote
735735
my$logfile =$self->logfile;
736736
my$name =$self->name;
737737
print"### Promoting node\"$name\"\n";
738-
TestLib::system_log('pg_ctl','-D',$pgdata,'-l',$logfile,'promote');
738+
TestLib::system_log('pg_ctl','-D',$pgdata,'-w','-l',$logfile,
739+
'promote');
739740
}
740741

741742
# Internal routine to enable streaming replication on a standby node.

‎src/test/recovery/t/004_timeline_switch.pl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@
5757
$node_standby_2->restart;
5858

5959
# Insert some data in standby 1 and check its presence in standby 2
60-
# to ensure that the timeline switch has been done. Standby 1 needs
61-
# to exit recovery first before moving on with the test.
62-
$node_standby_1->poll_query_until('postgres',
63-
"SELECT pg_is_in_recovery() <> true");
60+
# to ensure that the timeline switch has been done.
6461
$node_standby_1->safe_psql('postgres',
6562
"INSERT INTO tab_int VALUES (generate_series(1001,2000))");
6663
$until_lsn =$node_standby_1->safe_psql('postgres',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp