From a46881c0cc93a00020ae8cc37814513658d62cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 29 Dec 2017 10:05:19 +0200 Subject: [PATCH] MXS-1585: Check that the master refence is in use The check for the current master backend did not see if the backend was actually in use. This would be the case when the backend would be originally in use but would be later disabled. --- server/modules/routing/readwritesplit/rwsplit_route_stmt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/modules/routing/readwritesplit/rwsplit_route_stmt.c b/server/modules/routing/readwritesplit/rwsplit_route_stmt.c index 0f7ebae2e..0a0bc088c 100644 --- a/server/modules/routing/readwritesplit/rwsplit_route_stmt.c +++ b/server/modules/routing/readwritesplit/rwsplit_route_stmt.c @@ -1157,7 +1157,8 @@ static void log_master_routing_failure(ROUTER_CLIENT_SES *rses, bool found, bool handle_master_is_target(ROUTER_INSTANCE *inst, ROUTER_CLIENT_SES *rses, DCB **target_dcb) { - DCB *master_dcb = rses->rses_master_ref ? rses->rses_master_ref->bref_dcb : NULL; + DCB *master_dcb = rses->rses_master_ref && BREF_IS_IN_USE(rses->rses_master_ref) ? + rses->rses_master_ref->bref_dcb : NULL; DCB *curr_master_dcb = NULL; bool succp = rwsplit_get_dcb(&curr_master_dcb, rses, BE_MASTER, NULL, MAX_RLAG_UNDEFINED);