Assign master status immediately to the replacement master

As the failover status check is done after the pending status has been
moved to the current status, the do_failover should set the current status
of the server as Master.
This commit is contained in:
Markus Makela
2016-10-06 14:26:40 +03:00
parent 84cadd4c45
commit 81fa8c6c0c

View File

@ -1100,11 +1100,13 @@ void do_failover(MYSQL_MONITOR *handle, MONITOR_SERVERS *db)
db->server->unique_name);
}
server_clear_set_status(db->server, SERVER_SLAVE, SERVER_MASTER);
monitor_set_pending_status(db, SERVER_MASTER);
monitor_clear_pending_status(db, SERVER_SLAVE);
}
else
{
server_set_status(db->server, SERVER_MAINT);
monitor_set_pending_status(db, SERVER_MAINT);
}
db = db->next;