From 3857912c61590c8ace6ac6128b8604e8bf190403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 29 Mar 2018 03:41:00 +0300 Subject: [PATCH] MXS-1503: Abort connection when inside transaction Before the transaction migration is implemented, the connection must be closed if a transaction is open and the connection to the master is lost. Doing this retains the same transactionality as a direct connection to the server would. --- server/modules/routing/readwritesplit/readwritesplit.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/modules/routing/readwritesplit/readwritesplit.cc b/server/modules/routing/readwritesplit/readwritesplit.cc index c3553dc86..72c7bdf70 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.cc +++ b/server/modules/routing/readwritesplit/readwritesplit.cc @@ -1393,6 +1393,12 @@ static void handleError(MXS_ROUTER *instance, } } + if (session_trx_is_active(session)) + { + // We have an open transaction, we can't continue + can_continue = false; + } + *succp = can_continue; backend->close(); }