MXS-1476: Stop nodes instead of blocking them

This should actually disrupt the Galera cluster instead of just
temporarily disabling it.
This commit is contained in:
Markus Mäkelä 2017-11-24 14:14:55 +02:00
parent a418804c83
commit d69a36b4dd
2 changed files with 9 additions and 9 deletions

View File

@ -291,7 +291,7 @@ public:
* @param param command line parameters for DB server start command
* @return 0 if success
*/
int start_node(int node, const char* param);
int start_node(int node, const char* param = "");
/**
* @brief Check node via ssh and restart it if it is not resposible

View File

@ -13,25 +13,25 @@ void do_test(TestConnections& test, int master, int slave)
test.try_query(test.conn_rwsplit, "CREATE TABLE test.t1 (id int)");
test.try_query(test.conn_rwsplit, "INSERT INTO test.t1 VALUES (1)");
test.tprintf("Block a slave node and perform an insert");
test.galera->block_node(slave);
test.tprintf("Stop a slave node and perform an insert");
test.galera->stop_node(slave);
sleep(5);
test.try_query(test.conn_rwsplit, "INSERT INTO test.t1 VALUES (1)");
test.tprintf("Unblock the slave node and perform another insert");
test.galera->unblock_node(slave);
test.tprintf("Start the slave node and perform another insert");
test.galera->start_node(slave);
sleep(5);
test.try_query(test.conn_rwsplit, "INSERT INTO test.t1 VALUES (1)");
test.close_maxscale_connections();
test.tprintf("Block the master node and perform an insert");
test.galera->block_node(master);
test.tprintf("Stop the master node and perform an insert");
test.galera->stop_node(master);
sleep(5);
test.connect_maxscale();
test.try_query(test.conn_rwsplit, "INSERT INTO test.t1 VALUES (1)");
test.tprintf("Unblock the master node and perform another insert (expecting failure)");
test.galera->unblock_node(master);
test.tprintf("Start the master node and perform another insert (expecting failure)");
test.galera->start_node(master);
sleep(5);
test.add_result(execute_query_silent(test.conn_rwsplit, "INSERT INTO test.t1 VALUES (1)") == 0, "Query should fail");
test.close_maxscale_connections();