Skip to content

Commit cf4f468

Browse files
committed
Kill nodes after they fail to stop gracefully.
1 parent 3cd4143 commit cf4f468

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

contrib/mmts/Cluster.pm

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,18 @@ sub start
130130
sub stopnode
131131
{
132132
my ($node, $mode) = @_;
133-
my $port = $node->port;
134-
my $pgdata = $node->data_dir;
135-
my $name = $node->name;
133+
return 1 unless defined $node->{_pid};
136134
$mode = 'fast' unless defined $mode;
137-
diag("stopping node $name ${mode}ly at $pgdata port $port");
138-
next unless defined $node->{_pid};
139-
my $ret = 0;
135+
my $name = $node->name;
136+
diag("stopping $name ${mode}ly");
137+
140138
if ($mode eq '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
foreach my $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 to stop $name immediately");
209+
BAIL_OUT("failed to kill $name");
210210
}
211211
}
212212
}

contrib/mmts/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;

contrib/mmts/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;

contrib/mmts/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;

contrib/mmts/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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy