Assign stale master status to standalone masters

When a standalone master server is detected, it should receive the stale
status to prevent it from losing the master status if another server is
started and allow_cluster_recovery is enabled.
This commit is contained in:
Markus Mäkelä 2017-03-15 13:55:33 +02:00
parent 3396741c21
commit f384050d45

View File

@ -1015,9 +1015,10 @@ void do_failover(MYSQL_MONITOR *handle, MXS_MONITOR_SERVERS *db)
handle->warn_failover = false;
}
server_clear_set_status(db->server, SERVER_SLAVE, SERVER_MASTER);
monitor_set_pending_status(db, SERVER_MASTER);
server_clear_set_status(db->server, SERVER_SLAVE, SERVER_MASTER | SERVER_STALE_STATUS);
monitor_set_pending_status(db, SERVER_MASTER | SERVER_STALE_STATUS);
monitor_clear_pending_status(db, SERVER_SLAVE);
handle->master = db;
}
else if (!handle->allow_cluster_recovery)
{