MXS-2314 Define monitor state in terms of worker state

Worker::STOPPED    -> MONITOR_STATE_STOPPED
Worker::POLLING    -> MONITOR_STATE_RUNNING
Worker::PROCESSING -> MONITOR_STATE_RUNNING

By defining the monitor state from the worker state there is
no risk they will ever get out of sync. And there is one thing
less to maintain.
This commit is contained in:
Johan Wikman
2019-02-08 17:39:22 +02:00
parent 544e88a0b8
commit 7a99b5d253
5 changed files with 34 additions and 38 deletions

View File

@ -68,7 +68,7 @@ bool ClustrixMonitor::configure(const MXS_CONFIG_PARAMETER* pParams)
void ClustrixMonitor::populate_services()
{
mxb_assert(Monitor::m_state == MONITOR_STATE_STOPPED);
mxb_assert(state() == MONITOR_STATE_STOPPED);
// The servers that the Clustrix monitor has been configured with are
// only used for bootstrapping and services will not be populated