MXS-1588 Fix switchover

Change the ordering of the two flushes such that FLUSH LOGS comes last.
This seems to make sure gtid:s are updated to newest values before
the MASTER_GTID_WAIT-call. Without this fix, switchover does complete
succesfully, but some of the slaves may not be able to replicate due to
not having same events as new master. Exact reason for this still unclear.
This commit is contained in:
Esa Korhonen 2017-12-21 17:52:09 +02:00
parent 57fc623b84
commit 3ccd6eed28

View File

@ -3605,10 +3605,10 @@ static bool switchover_demote_master(MYSQL_MONITOR* mon,
const char* query = "SET GLOBAL read_only=1;";
if (mxs_mysql_query(current_master->con, query) == 0)
{
query = "FLUSH LOGS;";
query = "FLUSH TABLES;";
if (mxs_mysql_query(current_master->con, query) == 0)
{
query = "FLUSH TABLES;";
query = "FLUSH LOGS;";
if (mxs_mysql_query(current_master->con, query) == 0)
{
query = "";