Fix assignment of master status on failed servers

When the real root master server went down, it still received the master
status bit due to how the replication tree was built. The bit should only
be set for servers that are running.

Also fixed a false state change event when the master status bit was
manually cleared from the downed root master server.
This commit is contained in:
Markus Mäkelä
2017-03-10 09:11:17 +02:00
parent 4f03c53bdf
commit 6da8cfe97e
2 changed files with 11 additions and 5 deletions

View File

@ -1777,8 +1777,11 @@ static MXS_MONITOR_SERVERS *get_replication_tree(MXS_MONITOR *mon, int num_serve
master->server->unique_name);
ss_dassert(info);
/** Only set the Master status if read_only is disabled */
monitor_set_pending_status(master, info->read_only ? SERVER_SLAVE : SERVER_MASTER);
if (SERVER_IS_RUNNING(master->server))
{
/** Only set the Master status if read_only is disabled */
monitor_set_pending_status(master, info->read_only ? SERVER_SLAVE : SERVER_MASTER);
}
handle->master = master;
}