From 92057f6ff958901147bbff62387051bd4e6a9cb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 15 Oct 2018 13:35:27 +0300 Subject: [PATCH] Add more logging to readwritesplit When a read-only transaction fails due to a connection error, no message would be logged. Also added an info level message for the case when a backend connection would get closed before the session is in the correct state and a debug assertion that the router session should never be closed when the handleError method is called. --- server/modules/routing/readwritesplit/readwritesplit.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/modules/routing/readwritesplit/readwritesplit.cc b/server/modules/routing/readwritesplit/readwritesplit.cc index 2abb6a608..1e38b2618 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.cc +++ b/server/modules/routing/readwritesplit/readwritesplit.cc @@ -292,6 +292,10 @@ static void handle_error_reply_client(MXS_SESSION *ses, RWSplitSession *rses, CHK_DCB(client_dcb); client_dcb->func.write(client_dcb, gwbuf_clone(errmsg)); } + else + { + MXS_INFO("Closing router session that is not ready"); + } } static bool reroute_stored_statement(RWSplitSession *rses, const SRWBackend& old, GWBUF *stored) @@ -1335,6 +1339,7 @@ static void handleError(MXS_ROUTER *instance, if (rses->rses_closed) { + ss_dassert(!true); *succp = false; return; } @@ -1399,6 +1404,8 @@ static void handleError(MXS_ROUTER *instance, * Reset the target and close the session. */ rses->target_node.reset(); *succp = false; + MXS_ERROR("Connection to server %s failed while executing a read-only transaction", + backend->name()); } else {