Fix server usage bugs in monitors and servers

The MySQL Monitor did not reset the pointer to the root master reference
which would lead to a crash if the master was removed.

When service details were shown, it listed all servers that existed. Only
servers that haven't been removed or destroyed should be shown.
This commit is contained in:
Markus Makela
2016-11-11 08:31:28 +02:00
parent e67a829daf
commit 16e8aa7178
3 changed files with 12 additions and 11 deletions

View File

@ -270,7 +270,6 @@ startMonitor(MONITOR *monitor, const CONFIG_PARAMETER* params)
handle->replicationHeartbeat = 0;
handle->detectStaleMaster = true;
handle->detectStaleSlave = true;
handle->master = NULL;
handle->script = NULL;
handle->multimaster = false;
handle->mysql51_replication = false;
@ -281,6 +280,9 @@ startMonitor(MONITOR *monitor, const CONFIG_PARAMETER* params)
spinlock_init(&handle->lock);
}
/** This should always be reset to NULL */
handle->master = NULL;
while (params)
{
if (!strcmp(params->name, "detect_stale_master"))