diff --git a/server/modules/routing/binlogrouter/blr.c b/server/modules/routing/binlogrouter/blr.c index e9f1daf17..2e581d1c0 100644 --- a/server/modules/routing/binlogrouter/blr.c +++ b/server/modules/routing/binlogrouter/blr.c @@ -715,9 +715,12 @@ createInstance(SERVICE *service, char **options) /** Set SSL pointer in in server struct */ server->server_ssl = ssl_cfg; - /* Set server unique name */ /* Add server to service backend list */ 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 { inst->master_state = BLRM_UNCONNECTED; + /* Set backend server as active */ + service->dbref->server->is_active = true; + service->dbref->active = true; } /** diff --git a/server/modules/routing/binlogrouter/blr_slave.c b/server/modules/routing/binlogrouter/blr_slave.c index b3d94ae31..f1f6eefe5 100644 --- a/server/modules/routing/binlogrouter/blr_slave.c +++ b/server/modules/routing/binlogrouter/blr_slave.c @@ -1037,6 +1037,15 @@ blr_slave_query(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave, GWBUF *queue) 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 * and change state to BLRM_SLAVE_STOPPED