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

Commitdf87ce7

Browse files
kvapkelvich
authored andcommitted
Kill nodes after they fail to stop gracefully.
1 parente77a4ac commitdf87ce7

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

‎Cluster.pm

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,18 @@ sub start
130130
substopnode
131131
{
132132
my ($node,$mode) =@_;
133-
my$port =$node->port;
134-
my$pgdata =$node->data_dir;
135-
my$name =$node->name;
133+
return 1unlessdefined$node->{_pid};
136134
$mode ='fast'unlessdefined$mode;
137-
diag("stopping node$name${mode}ly at$pgdata port$port");
138-
nextunlessdefined$node->{_pid};
139-
my$ret = 0;
135+
my$name =$node->name;
136+
diag("stopping$name${mode}ly");
137+
140138
if ($modeeq'kill') {
141139
killtree($node->{_pid});
142-
}else {
143-
$ret = TestLib::system_log('pg_ctl','-D',$pgdata,'-m','fast','stop');
140+
return 1;
144141
}
142+
143+
my$pgdata =$node->data_dir;
144+
my$ret = TestLib::system_log('pg_ctl','-D',$pgdata,'-m','fast','stop');
145145
$node->{_pid} =undef;
146146
$node->_update_pid;
147147

@@ -204,9 +204,9 @@ sub stop
204204
foreachmy$node (@$nodes) {
205205
if (!stopnode($node,$mode)) {
206206
$ok = 0;
207-
if (!stopnode($node,'immediate')) {
207+
if (!stopnode($node,'kill')) {
208208
my$name =$node->name;
209-
BAIL_OUT("failed tostop$name immediately");
209+
BAIL_OUT("failed tokill$name");
210210
}
211211
}
212212
}

‎t/000_deadlock.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,5 @@ sub query_exec_async
9393

9494
query_row($conns[0],"select * from t where k = 1");
9595

96-
ok($cluster->stop('kill'),"cluster stops");
96+
ok($cluster->stop('fast'),"cluster stops");
9797
1;

‎t/001_basic_recovery.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,5 @@
108108

109109
is($psql_out,'90',"Check replication after failed node recovery.");
110110

111-
ok($cluster->stop('kill'),"cluster stops");
111+
ok($cluster->stop('fast'),"cluster stops");
112112
1;

‎t/002_cross.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,5 +150,5 @@ sub parse_state
150150

151151
is($anomalies, 0,"no cross anomalies after$selects selects");
152152

153-
ok($cluster->stop('kill'),"cluster stops");
153+
ok($cluster->stop('fast'),"cluster stops");
154154
1;

‎t/003_pgbench.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,5 @@ sub writer
110110
($rc,$out,$err) =$cluster->psql(0,'postgres',"select count(*) from reader_log where v = 0;");
111111
isnt($out, 0,"there are some zeros in reader_log");
112112

113-
ok($cluster->stop('kill'),"cluster stops");
113+
ok($cluster->stop('fast'),"cluster stops");
114114
1;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp