Skip to content

Commit f30d3eb

Browse files
committed
Merge branch 'mysql-5.5-cluster-7.2' into mysql-5.6-cluster-7.3
2 parents 1c73a7a + 31a2a71 commit f30d3eb

File tree

3 files changed

+28
-26
lines changed

3 files changed

+28
-26
lines changed

storage/ndb/test/run-test/atrt.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -154,7 +154,8 @@ bool wait_for_processes_to_stop(atrt_config& config,
154154
bool wait_for_process_to_stop(atrt_config& config, atrt_process& proc,
155155
int retries = 5, int wait_between_retries_s = 5);
156156

157-
int is_running(atrt_config&, int);
157+
int check_ndb_or_servers_failures(atrt_config& config);
158+
bool is_client_running(atrt_config&);
158159
bool gather_result(atrt_config&, int* result);
159160

160161
int read_test_case(FILE*, atrt_testcase&, int& line);

storage/ndb/test/run-test/autotest-run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
##############
2727

2828
save_args=$*
29-
VERSION="autotest-run.sh version 1.16"
29+
VERSION="autotest-run.sh version 1.17"
3030

3131
DATE=`date '+%Y-%m-%d'`
3232
if [ `uname -s` != "SunOS" ]

storage/ndb/test/run-test/main.cpp

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -416,20 +416,12 @@ int main(int argc, char **argv) {
416416
goto cleanup;
417417
}
418418

419-
if (is_running(g_config, p_ndb) != 2) {
420-
g_logger.critical("Failure on data/mgmd node(s)");
421-
result = ERR_NDB_FAILED;
419+
if ((result = check_ndb_or_servers_failures(g_config))) {
422420
break;
423421
}
424422

425-
if (is_running(g_config, p_servers) != 2) {
426-
g_logger.critical("Failure on server(s)");
427-
result = ERR_SERVERS_FAILED;
428-
break;
429-
}
430-
431-
if (is_running(g_config, p_clients) == 0) {
432-
break;
423+
if (!is_client_running(g_config)) {
424+
break;
433425
}
434426

435427
if (!do_command(g_config)) {
@@ -1162,25 +1154,34 @@ bool update_status(atrt_config &config, int types, bool fail_on_missing) {
11621154
return true;
11631155
}
11641156

1165-
int is_running(atrt_config &config, int types) {
1166-
int found = 0, running = 0;
1157+
int check_ndb_or_servers_failures(atrt_config &config) {
1158+
int result = 0;
1159+
const int types = p_ndb | p_servers;
11671160
for (unsigned i = 0; i < config.m_processes.size(); i++) {
11681161
atrt_process &proc = *config.m_processes[i];
11691162
if ((types & proc.m_type) != 0) {
1170-
found++;
1171-
if (proc.m_proc.m_status == "running")
1172-
running++;
1173-
else {
1174-
if (IF_WIN(proc.m_type & atrt_process::AP_MYSQLD, 0)) {
1175-
running++;
1176-
}
1163+
if (!(proc.m_proc.m_status == "running" ||
1164+
IF_WIN(proc.m_type & atrt_process::AP_MYSQLD, 0))) {
1165+
g_logger.critical("%s #%d not running on %s", proc.m_name.c_str(),
1166+
proc.m_index, proc.m_host->m_hostname.c_str());
1167+
if (p_ndb & proc.m_type)
1168+
result = ERR_NDB_FAILED;
1169+
else if (p_servers & proc.m_type)
1170+
result = ERR_SERVERS_FAILED;
11771171
}
11781172
}
11791173
}
1174+
return result;
1175+
}
11801176

1181-
if (found == running) return 2;
1182-
if (running == 0) return 0;
1183-
return 1;
1177+
bool is_client_running(atrt_config &config) {
1178+
for (unsigned i = 0; i < config.m_processes.size(); i++) {
1179+
atrt_process &proc = *config.m_processes[i];
1180+
if ((p_clients & proc.m_type) != 0 && proc.m_proc.m_status == "running") {
1181+
return true;
1182+
}
1183+
}
1184+
return false;
11841185
}
11851186

11861187
bool wait_for_processes_to_stop(atrt_config &config, int types, int retries,

0 commit comments

Comments
 (0)