Reset default master node state as well

Now that mariadbmon supports failover and switchover, a test may
may change the master to some other node than node 0.

Consequently, as part of fixing the replication, gtid_slave_pos
of node 0 must be reset as well.
This commit is contained in:
Johan Wikman
2018-01-05 11:49:23 +02:00
parent 396c8405be
commit 3c5963cf3b

View File

@ -383,7 +383,7 @@ int Mariadb_nodes::start_replication()
connect();
for (int i = 1; i < N; i++)
for (int i = 0; i < N; i++)
{
execute_query(nodes[i], "STOP SLAVE;");
@ -392,6 +392,8 @@ int Mariadb_nodes::start_replication()
execute_query(nodes[i], "SET GLOBAL gtid_slave_pos='0-1-0'");
}
if (i != 0)
{
// TODO: Reuse the code in sync_slaves() to get the actual file name and position
execute_query(nodes[i],
"CHANGE MASTER TO "
@ -404,6 +406,7 @@ int Mariadb_nodes::start_replication()
execute_query(nodes[i], "START SLAVE");
}
}
return local_result;
}