Add test case for ignore_external_masters + failover

The test checks that failover works even when the master of the monitored
cluster is a slave to an external masters. The test also verifies that the
servers do not get unexpected status labels.
This commit is contained in:
Markus Mäkelä
2018-02-07 00:41:49 +02:00
parent 8bf756ca56
commit 6a1aba70e7
9 changed files with 241 additions and 34 deletions

View File

@ -8,18 +8,7 @@ using std::endl;
void replicate_from(TestConnections& test, int server_ind, int target_ind)
{
stringstream change_master;
change_master << "CHANGE MASTER TO MASTER_HOST = '" << test.repl->IP[target_ind]
<< "', MASTER_PORT = " << test.repl->port[target_ind] << ", MASTER_USE_GTID = current_pos, "
"MASTER_USER='repl', MASTER_PASSWORD='repl';";
cout << "Server " << server_ind + 1 << " starting to replicate from server " << target_ind + 1 << endl;
if (test.verbose)
{
cout << "Query is '" << change_master.str() << "'" << endl;
}
execute_query(test.repl->nodes[server_ind], "STOP SLAVE;");
execute_query(test.repl->nodes[server_ind], change_master.str().c_str());
execute_query(test.repl->nodes[server_ind], "START SLAVE;");
test.repl->replicate_from(server_ind, target_ind);
}
void reset_replication(TestConnections& test)