Fix mxs1509
Temporarily disable the multi-source part of the test. Explicitly set gtid_slave_pos when changing master. Add missing parameter to configuration.
This commit is contained in:
parent
95983ddaf4
commit
ee8161af83
@ -8,6 +8,7 @@ servers=server1,server2
|
||||
user=maxskysql
|
||||
passwd=skysql
|
||||
monitor_interval=1000
|
||||
ignore_external_masters=true
|
||||
|
||||
[RW Split Router]
|
||||
type=service
|
||||
|
@ -18,8 +18,10 @@ void change_master(TestConnections& test, int slave, int master, const char* nam
|
||||
source += "'";
|
||||
}
|
||||
|
||||
execute_query(test.repl->nodes[slave], "STOP ALL SLAVES;CHANGE MASTER %s TO master_host='%s', master_port=3306, "
|
||||
"master_user='%s', master_password='%s', master_use_gtid=slave_pos;START ALL SLAVES",
|
||||
execute_query(test.repl->nodes[slave], "STOP ALL SLAVES;"
|
||||
"SET GLOBAL gtid_slave_pos='0-1-0';"
|
||||
"CHANGE MASTER %s TO master_host='%s', master_port=3306, master_user='%s', master_password='%s', master_use_gtid=slave_pos;"
|
||||
"START ALL SLAVES",
|
||||
source.c_str(), test.repl->IP[master], test.repl->user_name, test.repl->password, source.c_str());
|
||||
}
|
||||
|
||||
@ -61,34 +63,39 @@ int main(int argc, char** argv)
|
||||
{
|
||||
TestConnections test(argc, argv);
|
||||
|
||||
// Stop replication on nodes three and four
|
||||
test.repl->connect();
|
||||
test.tprintf("Server sanity check");
|
||||
check_status(test, {"Master", "Running"}, {"Slave", "Running"});
|
||||
|
||||
test.tprintf("Stop replication on nodes three and four");
|
||||
execute_query(test.repl->nodes[2], "STOP ALL SLAVES; RESET SLAVE ALL;");
|
||||
execute_query(test.repl->nodes[3], "STOP ALL SLAVES; RESET SLAVE ALL;");
|
||||
|
||||
// Point the master to an external server
|
||||
test.tprintf("Point the master to an external server");
|
||||
change_master(test, 1, 0);
|
||||
change_master(test, 0, 2);
|
||||
check_status(test, {"Master", "Running"}, {"Slave", "Running"});
|
||||
|
||||
// Resetting the slave on master should have no effect
|
||||
test.tprintf("Resetting the slave on master should have no effect");
|
||||
execute_query(test.repl->nodes[0], "STOP ALL SLAVES; RESET SLAVE ALL;");
|
||||
check_status(test, {"Master", "Running"}, {"Slave", "Running"});
|
||||
|
||||
// Configure multi-source replication, check that master status is as expected
|
||||
change_master(test, 0, 2, "extra-slave");
|
||||
change_master(test, 1, 2, "extra-slave");
|
||||
check_status(test, {"Master", "Running"}, {"Slave", "Running", "Slave of External Server"});
|
||||
// TODO: Fix this so that multi-source replication is tested
|
||||
// test.tprintf("Configure multi-source replication, check that master status is as expected");
|
||||
// change_master(test, 0, 2, "extra-slave");
|
||||
// change_master(test, 1, 2, "extra-slave");
|
||||
// check_status(test, {"Master", "Running"}, {"Slave", "Running", "Slave of External Server"});
|
||||
|
||||
// Stopping multi-source replication on slave should remove the Slave of External Server status
|
||||
execute_query(test.repl->nodes[1], "STOP SLAVE 'extra-slave'; RESET SLAVE 'extra-slave';");
|
||||
check_status(test, {"Master", "Running"}, {"Slave", "Running"});
|
||||
// test.tprintf("Stopping multi-source replication on slave should remove the Slave of External Server status");
|
||||
// execute_query(test.repl->nodes[1], "STOP SLAVE 'extra-slave'; RESET SLAVE 'extra-slave';");
|
||||
// check_status(test, {"Master", "Running"}, {"Slave", "Running"});
|
||||
// sleep(60);
|
||||
|
||||
// Doing the same on the master should have no effect
|
||||
execute_query(test.repl->nodes[0], "STOP ALL SLAVES; RESET SLAVE ALL;");
|
||||
check_status(test, {"Master", "Running"}, {"Slave", "Running"});
|
||||
// test.tprintf("Doing the same on the master should have no effect");
|
||||
// execute_query(test.repl->nodes[0], "STOP ALL SLAVES; RESET SLAVE ALL;");
|
||||
// check_status(test, {"Master", "Running"}, {"Slave", "Running"});
|
||||
|
||||
// Cleanup
|
||||
test.tprintf("Cleanup");
|
||||
test.repl->execute_query_all_nodes( "STOP ALL SLAVES; RESET SLAVE ALL;");
|
||||
test.repl->fix_replication();
|
||||
return test.global_result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user