MXS-1513: Flush logs before tables during switchover_demote_master

In this order, the new binary log file will have 1 event instead of 0.
In total, only 1 event is added.
This commit is contained in:
Esa Korhonen 2017-12-07 12:23:41 +02:00
parent 3c88bf1ec6
commit b29a8eb4f8

View File

@ -3598,10 +3598,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 TABLES;";
query = "FLUSH LOGS;";
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 = "";