From 621444e5e43ec2fbf0414325f39bd77f4bd85c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Sun, 8 Oct 2017 23:25:05 +0300 Subject: [PATCH] Fix error messages in sync_slaves Fixed missing newlines in the error output printf calls of sync_slaves. Changed the order of commands pers_02 executes to a more correct way. --- maxscale-system-test/mariadb_nodes.cpp | 9 +++++---- maxscale-system-test/pers_02.cpp | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/maxscale-system-test/mariadb_nodes.cpp b/maxscale-system-test/mariadb_nodes.cpp index acd683f74..4b8dc3403 100644 --- a/maxscale-system-test/mariadb_nodes.cpp +++ b/maxscale-system-test/mariadb_nodes.cpp @@ -1299,14 +1299,15 @@ static void wait_until_pos(MYSQL *mysql, int filenum, int pos) void Mariadb_nodes::sync_slaves(int node) { - if (this->nodes[node] == NULL) + if (this->nodes[node] == NULL && this->connect()) { - this->connect(); + printf("Failed to connect to all nodes.\n"); + return; } if (mysql_query(this->nodes[node], "SHOW MASTER STATUS")) { - printf("Failed to execute SHOW MASTER STATUS: %s", mysql_error(this->nodes[node])); + printf("Failed to execute SHOW MASTER STATUS: %s\n", mysql_error(this->nodes[node])); } else { @@ -1334,7 +1335,7 @@ void Mariadb_nodes::sync_slaves(int node) } else { - printf("Cannot sync slaves, invalid binlog file name: %s", row[0]); + printf("Cannot sync slaves, invalid binlog file name: %s\n", row[0]); } } mysql_free_result(res); diff --git a/maxscale-system-test/pers_02.cpp b/maxscale-system-test/pers_02.cpp index af588cecb..511e12497 100644 --- a/maxscale-system-test/pers_02.cpp +++ b/maxscale-system-test/pers_02.cpp @@ -25,9 +25,10 @@ int main(int argc, char *argv[]) Test->create_connections(75, true, true, true, true); Test->stop_timeout(); + Test->repl->close_connections(); Test->repl->stop_nodes(); Test->repl->start_replication(); - Test->repl->close_connections(); + Test->repl->connect(); Test->repl->sync_slaves(); Test->set_timeout(60);