Fix MXS-1418 regression

If a server is removed from a service, readconnroute will not verify that
the server it is connected to is still the same root master. This fixes
the regression of MXS-1418.
This commit is contained in:
Markus Mäkelä 2018-02-20 15:35:52 +02:00
parent b1300fdb01
commit f3e00431de
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -551,12 +551,20 @@ static inline bool connection_is_valid(ROUTER_INSTANCE* inst, ROUTER_CLIENT_SES*
if (SERVER_IS_RUNNING(router_cli_ses->backend->server) &&
(router_cli_ses->backend->server->status & inst->bitmask & inst->bitvalue))
{
if (inst->bitvalue & SERVER_MASTER)
if ((inst->bitvalue & SERVER_MASTER) && router_cli_ses->backend->active)
{
// If we're using an active master server, verify that it is still a master
rval = router_cli_ses->backend == get_root_master(inst->service->dbref);
}
else
{
/**
* Either we don't use master type servers or the server reference
* is deactivated. We let deactivated connection close gracefully
* so we simply assume it is OK. This allows a server to be taken
* out of use in a manner that won't cause errors to the connected
* clients.
*/
rval = true;
}
}