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:
parent
b1300fdb01
commit
f3e00431de
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user