From c2d3bdf7ef9ffb84b0a8b5352999a7a66891a84b Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Fri, 25 Jan 2019 16:58:02 +0200 Subject: [PATCH] MXS-2273 Make schemarouter honour BEING_DRAINED bit The schema router now deals with the being drained bit the same way it deals with the maintenance bit, that is, a server being drained will simply be ignored. TODO: This behaviour needs to be document. TODO: It seems the schema router simply ignores the maintenance bit once a connection has been establisdhed. --- server/modules/routing/schemarouter/schemarouterinstance.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/modules/routing/schemarouter/schemarouterinstance.cc b/server/modules/routing/schemarouter/schemarouterinstance.cc index adfcf3bb0..635c064e0 100644 --- a/server/modules/routing/schemarouter/schemarouterinstance.cc +++ b/server/modules/routing/schemarouter/schemarouterinstance.cc @@ -127,7 +127,7 @@ bool connect_backend_servers(SSRBackendList& backends, MXS_SESSION* session) { SERVER_REF* b = (*it)->backend(); - if (b->server->is_usable()) + if (b->server->is_connectable()) { servers_found += 1; @@ -187,7 +187,7 @@ SchemaRouterSession* SchemaRouter::newSession(MXS_SESSION* pSession) for (SERVER_REF* ref = m_service->dbref; ref; ref = ref->next) { - if (ref->active) + if (server_ref_is_active(ref)) { backends.push_back(SSRBackend(new SRBackend(ref))); }