diff --git a/maxscale-system-test/mariadb_nodes.cpp b/maxscale-system-test/mariadb_nodes.cpp index 8d8fe5a20..53b195899 100644 --- a/maxscale-system-test/mariadb_nodes.cpp +++ b/maxscale-system-test/mariadb_nodes.cpp @@ -633,13 +633,13 @@ bool Mariadb_nodes::check_master_node(MYSQL *conn) } /** - * @brief bad_slave_thread_status Check if filed in the slave status outpur is not 'yes' + * @brief bad_slave_thread_status Check if field in the slave status outpur is not 'yes' * @param conn MYSQL struct (connection have to be open) - * @param field Filed to check + * @param field Field to check * @param node Node index - * @return false if requested filed is 'Yes' + * @return false if requested field is 'Yes' */ -static bool bad_slave_thread_status(MYSQL *conn, const char *field, int node) +bool Mariadb_nodes::bad_slave_thread_status(MYSQL *conn, const char *field, int node) { char str[1024] = ""; bool rval = false; @@ -650,23 +650,29 @@ static bool bad_slave_thread_status(MYSQL *conn, const char *field, int node) if (find_field(conn, "SHOW SLAVE STATUS;", field, str) != 0) { printf("Node %d: %s not found in SHOW SLAVE STATUS\n", node, field); - fflush(stdout); break; } - else if (strcmp(str, "Yes") == 0 || strcmp(str, "No") == 0) + + if (verbose) + { + printf("Node %d: field %s is %s\n", node, field, str); + } + + if (strcmp(str, "Yes") == 0 || strcmp(str, "No") == 0) { - printf("Node %d: filed %s is %s\n", node, field, str); break; } - printf("Node %d: filed %s is %s\n", node, field, str); + /** Any other state is transient and we should try again */ sleep(1); } if (strcmp(str, "Yes") != 0) { - printf("Node %d: %s is '%s'\n", node, field, str); - fflush(stdout); + if (verbose) + { + printf("Node %d: %s is '%s'\n", node, field, str); + } rval = true; } @@ -760,7 +766,6 @@ int Mariadb_nodes::check_replication() bool Mariadb_nodes::fix_replication() { - verbose = true; if (check_replication()) { unblock_all_nodes(); diff --git a/maxscale-system-test/mariadb_nodes.h b/maxscale-system-test/mariadb_nodes.h index 1ba343f14..13664eb5d 100644 --- a/maxscale-system-test/mariadb_nodes.h +++ b/maxscale-system-test/mariadb_nodes.h @@ -415,6 +415,7 @@ public: private: bool check_master_node(MYSQL *conn); + bool bad_slave_thread_status(MYSQL *conn, const char *field, int node); }; class Galera_nodes : public Mariadb_nodes