Files
MaxScale/maxscale-system-test/mxs1643_extra_events.cpp
Markus Mäkelä 0808f66aaa Update older mysqlmon tests
Some of the older tests expected results that didn't make much sense. The
mxs1643_extra_events test should expect the master to devolve into the
Running state when it is set into read-only. This is understandable as a
set of servers consisting only of slaves is rather disorienting.

In mxs1678_relay_master breaking the replication of the relay master
devolves it into the Running state as well as all slaves replicating from
it. This is a better result as in a real-life scenario only the valid and
up-to-date slaves would be used.
2018-07-17 11:52:18 +03:00

32 lines
1.3 KiB
C++

/**
* MXS-1643: Too many monitor events are triggered
*
* https://jira.mariadb.org/browse/MXS-1643
*/
#include "testconnections.h"
int main(int argc, char** argv)
{
TestConnections test(argc, argv);
// Check that master gets the slave status when set into read-only mode
test.tprintf("Set master into read-only mode");
test.repl->connect();
execute_query(test.repl->nodes[0], "SET GLOBAL read_only=ON");
test.maxscales->wait_for_monitor();
test.tprintf("Check that the current master now has the slave label");
test.check_log_err(0, "[Master, Running] -> [Running]", true);
test.check_log_err(0, "[Master, Running] -> [Slave, Running]", false);
test.maxscales->ssh_node_f(0, true, "truncate -s 0 /var/log/maxscale/maxscale.log");
// Check that the Master and Slave status aren't both set
execute_query(test.repl->nodes[0], "SET GLOBAL read_only=OFF");
test.maxscales->wait_for_monitor();
test.tprintf("Check that the new master doesn't have both slave and master labels");
test.check_log_err(0, "[Slave, Running] -> [Master, Slave, Running]", false);
test.check_log_err(0, "[Slave, Running] -> [Master, Running]", false);
test.check_log_err(0, "[Running] -> [Master, Running]", true);
return test.global_result;
}