From f384050d45715f13a0a5b0c976b5f1342335eeb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 15 Mar 2017 13:55:33 +0200 Subject: [PATCH] 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. --- server/modules/monitor/mysqlmon/mysql_mon.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/modules/monitor/mysqlmon/mysql_mon.c b/server/modules/monitor/mysqlmon/mysql_mon.c index e4e5f26b3..387f1e6e8 100644 --- a/server/modules/monitor/mysqlmon/mysql_mon.c +++ b/server/modules/monitor/mysqlmon/mysql_mon.c @@ -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) {