From 639b0af6aa2a62c07f996ff6695b500d3c037824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 28 Oct 2019 09:01:23 +0200 Subject: [PATCH] MXS-2734: Check preferred server on table conflict If the schemarouter detects a table conflict in a query and one of the servers is the preferred one, don't log an error. --- .../modules/routing/schemarouter/schemaroutersession.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/modules/routing/schemarouter/schemaroutersession.cc b/server/modules/routing/schemarouter/schemaroutersession.cc index 1c6da4173..d442fd81e 100644 --- a/server/modules/routing/schemarouter/schemaroutersession.cc +++ b/server/modules/routing/schemarouter/schemaroutersession.cc @@ -1644,9 +1644,12 @@ SERVER* SchemaRouterSession::get_query_target(GWBUF* buffer) { if (rval && target != rval) { - MXS_ERROR("Query targets tables on servers '%s' and '%s'. " - "Cross server queries are not supported.", - rval->name(), target->name()); + if (target != m_config->preferred_server && rval != m_config->preferred_server) + { + MXS_ERROR("Query targets tables on servers '%s' and '%s'. " + "Cross server queries are not supported.", + rval->name(), target->name()); + } } else if (rval == NULL) {