Reset slave when changing master

When the test changes the master, it should reset the slave configuration
on the new master. This way no circular replication topologies are formed
and the monitor can be expected to perform correctly.
This commit is contained in:
Markus Mäkelä
2018-03-05 11:18:26 +02:00
parent 019312c4ee
commit 65216f5e16

View File

@ -340,7 +340,10 @@ int Mariadb_nodes::change_master(int NewMaster, int OldMaster)
execute_query(nodes[i], "stop slave;");
}
}
execute_query(nodes[NewMaster], "STOP SLAVE");
execute_query(nodes[NewMaster], "RESET SLAVE ALL");
execute_query(nodes[NewMaster], create_repl_user);
execute_query(nodes[OldMaster], "reset master;");
find_field(nodes[NewMaster], "show master status", "File", &log_file[0]);
find_field(nodes[NewMaster], "show master status", "Position", &log_pos[0]);