Only block nodes in mxs1476
This is less of a disruption to the whole Galera cluster, which appears to go non-primary if the nodes are stopped instead of blocked.
This commit is contained in:
@ -259,7 +259,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 if all slaves have "Slave_IO_Running" set to "Yes" and master has N-1 slaves
|
||||
|
||||
@ -14,24 +14,24 @@ void do_test(TestConnections& test, int master, int slave)
|
||||
test.try_query(test.maxscales->conn_rwsplit[0], "INSERT INTO test.t1 VALUES (1)");
|
||||
|
||||
test.tprintf("Stop a slave node and perform an insert");
|
||||
test.galera->stop_node(slave);
|
||||
test.galera->block_node(slave);
|
||||
sleep(5);
|
||||
test.try_query(test.maxscales->conn_rwsplit[0], "INSERT INTO test.t1 VALUES (1)");
|
||||
|
||||
test.tprintf("Start the slave node and perform another insert");
|
||||
test.galera->start_node(slave, (char*)"");
|
||||
test.galera->unblock_node(slave);
|
||||
sleep(5);
|
||||
test.try_query(test.maxscales->conn_rwsplit[0], "INSERT INTO test.t1 VALUES (1)");
|
||||
test.maxscales->close_maxscale_connections(0);
|
||||
|
||||
test.tprintf("Stop the master node and perform an insert");
|
||||
test.galera->stop_node(master);
|
||||
test.galera->block_node(master);
|
||||
sleep(5);
|
||||
test.maxscales->connect_maxscale(0);
|
||||
test.try_query(test.maxscales->conn_rwsplit[0], "INSERT INTO test.t1 VALUES (1)");
|
||||
|
||||
test.tprintf("Start the master node and perform another insert (expecting failure)");
|
||||
test.galera->start_node(master, (char*)"");
|
||||
test.galera->unblock_node(master);
|
||||
sleep(5);
|
||||
test.add_result(execute_query_silent(test.maxscales->conn_rwsplit[0], "INSERT INTO test.t1 VALUES (1)") == 0,
|
||||
"Query should fail");
|
||||
@ -57,8 +57,8 @@ int main(int argc, char** argv)
|
||||
|
||||
do_test(test, 0, 1);
|
||||
|
||||
test.galera->start_node(2, (char *) "");
|
||||
test.galera->start_node(3, (char *) "");
|
||||
test.galera->start_node(2);
|
||||
test.galera->start_node(3);
|
||||
test.galera->fix_replication();
|
||||
return test.global_result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user