MXS-2314 Server added to monitor should be added to service
If the servers of a service are defined by a monitor (the config has 'cluster=SomeMonitor'), then the addition of a server to a a monitor should lead to that server being added to the service.
This commit is contained in:
@ -161,6 +161,19 @@ void service_add_server(Monitor* pMonitor, SERVER* pServer)
|
||||
}
|
||||
}
|
||||
|
||||
void service_remove_server(Monitor* pMonitor, SERVER* pServer)
|
||||
{
|
||||
LockGuard guard(this_unit.lock);
|
||||
|
||||
for (Service* pService : this_unit.services)
|
||||
{
|
||||
if (pService->m_monitor == pMonitor)
|
||||
{
|
||||
serviceRemoveBackend(pService, pServer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Service::Service(const std::string& service_name,
|
||||
const std::string& router_name,
|
||||
MXS_CONFIG_PARAMETER* params)
|
||||
|
||||
Reference in New Issue
Block a user