MXS-1848 Change prototype of startMonitor
StartMonitor() now takes a MXS_MONITOR_INSTANCE and returns true, if the monitor could be started and false otherwise. So, the setup is such that in createInstance(), the instance data is created and then using startMonitor() and stopMonitor() the monitor is started/stopped. Finally in destroyInstance(), the actual instance data is deleted.
This commit is contained in:
@ -71,7 +71,8 @@ bool MariaDBMonitor::manual_switchover(SERVER* new_master, SERVER* current_maste
|
||||
|
||||
if (stopped)
|
||||
{
|
||||
MariaDBMonitor::create_and_start(m_monitor_base, m_monitor_base->parameters);
|
||||
// TODO: What if this fails?
|
||||
start(m_monitor_base->parameters);
|
||||
}
|
||||
return rval;
|
||||
}
|
||||
@ -105,7 +106,8 @@ bool MariaDBMonitor::manual_failover(json_t** output)
|
||||
|
||||
if (stopped)
|
||||
{
|
||||
MariaDBMonitor::create_and_start(m_monitor_base, m_monitor_base->parameters);
|
||||
// TODO: What if this fails?
|
||||
start(m_monitor_base->parameters);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@ -178,7 +180,8 @@ bool MariaDBMonitor::manual_rejoin(SERVER* rejoin_server, json_t** output)
|
||||
|
||||
if (stopped)
|
||||
{
|
||||
MariaDBMonitor::create_and_start(m_monitor_base, m_monitor_base->parameters);
|
||||
// TODO: What if this fails?
|
||||
start(m_monitor_base->parameters);
|
||||
}
|
||||
return rval;
|
||||
}
|
||||
|
Reference in New Issue
Block a user