MXS-1458: Mark backend server as inactive if router is not configured.
MXS-1458: Mark backend server as inactive if router is not configured.
This commit is contained in:
@ -715,9 +715,12 @@ createInstance(SERVICE *service, char **options)
|
|||||||
/** Set SSL pointer in in server struct */
|
/** Set SSL pointer in in server struct */
|
||||||
server->server_ssl = ssl_cfg;
|
server->server_ssl = ssl_cfg;
|
||||||
|
|
||||||
/* Set server unique name */
|
|
||||||
/* Add server to service backend list */
|
/* Add server to service backend list */
|
||||||
serviceAddBackend(inst->service, server);
|
serviceAddBackend(inst->service, server);
|
||||||
|
|
||||||
|
/* Hide backend server struct */
|
||||||
|
service->dbref->server->is_active = false;
|
||||||
|
service->dbref->active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -766,6 +769,9 @@ createInstance(SERVICE *service, char **options)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
inst->master_state = BLRM_UNCONNECTED;
|
inst->master_state = BLRM_UNCONNECTED;
|
||||||
|
/* Set backend server as active */
|
||||||
|
service->dbref->server->is_active = true;
|
||||||
|
service->dbref->active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1037,6 +1037,15 @@ blr_slave_query(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave, GWBUF *queue)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Mark as active the master server struct */
|
||||||
|
spinlock_acquire(&router->lock);
|
||||||
|
if (!router->service->dbref->server->is_active)
|
||||||
|
{
|
||||||
|
router->service->dbref->server->is_active = true;
|
||||||
|
router->service->dbref->active = true;
|
||||||
|
}
|
||||||
|
spinlock_release(&router->lock);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check if router is BLRM_UNCONFIGURED
|
* check if router is BLRM_UNCONFIGURED
|
||||||
* and change state to BLRM_SLAVE_STOPPED
|
* and change state to BLRM_SLAVE_STOPPED
|
||||||
|
|||||||
Reference in New Issue
Block a user