From 01822490ca386d85ce65070d2d6aac02ceca23c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 26 Jun 2019 10:05:21 +0300 Subject: [PATCH] Fix avrorouter and `cluster` usage The servers defined by `cluster` wouldn't get used. --- include/maxscale/config.hh | 1 + server/modules/routing/avrorouter/avro.cc | 2 +- server/modules/routing/avrorouter/avro_main.cc | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/maxscale/config.hh b/include/maxscale/config.hh index ac945045e..335a641e0 100644 --- a/include/maxscale/config.hh +++ b/include/maxscale/config.hh @@ -114,6 +114,7 @@ extern const char CN_CACHE_SIZE[]; extern const char CN_CACHE[]; extern const char CN_CLASSIFICATION[]; extern const char CN_CLASSIFY[]; +extern const char CN_CLUSTER[]; extern const char CN_CONNECTION_TIMEOUT[]; extern const char CN_DATA[]; extern const char CN_DEFAULT[]; diff --git a/server/modules/routing/avrorouter/avro.cc b/server/modules/routing/avrorouter/avro.cc index 54e33406a..68b836474 100644 --- a/server/modules/routing/avrorouter/avro.cc +++ b/server/modules/routing/avrorouter/avro.cc @@ -133,7 +133,7 @@ Avro::Avro(SERVICE* service, MXS_CONFIG_PARAMETER* params, SERVICE* source, SRow , handler(service, handler, params->get_compiled_regex("match", 0, NULL).release(), params->get_compiled_regex("exclude", 0, NULL).release()) { - if (params->contains(CN_SERVERS)) + if (params->contains(CN_SERVERS) || params->contains(CN_CLUSTER)) { MXS_NOTICE("Replicating directly from a master server"); cdc::Config cnf; diff --git a/server/modules/routing/avrorouter/avro_main.cc b/server/modules/routing/avrorouter/avro_main.cc index 634e310eb..c940fd5fc 100644 --- a/server/modules/routing/avrorouter/avro_main.cc +++ b/server/modules/routing/avrorouter/avro_main.cc @@ -68,7 +68,7 @@ MXS_ROUTER* createInstance(SERVICE* service, MXS_CONFIG_PARAMETER* params) Avro* router = Avro::create(service, handler); - if (router && !params->contains(CN_SERVERS)) + if (router && !params->contains(CN_SERVERS) && !params->contains(CN_CLUSTER)) { conversion_task_ctl(router, true); }