From 370483fb4bd40da5293b067abc9b3ec7be2d83b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Sat, 10 Nov 2018 08:00:35 +0200 Subject: [PATCH] Log slave error message on failed session command If the master succeeds in executing a session command but the slave fails, the error message could help explain why it failed. At the moment this is mainly relevant for inspection of test results. --- .../modules/routing/readwritesplit/rwsplit_session_cmd.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/modules/routing/readwritesplit/rwsplit_session_cmd.cc b/server/modules/routing/readwritesplit/rwsplit_session_cmd.cc index 562e272b7..43aea773a 100644 --- a/server/modules/routing/readwritesplit/rwsplit_session_cmd.cc +++ b/server/modules/routing/readwritesplit/rwsplit_session_cmd.cc @@ -141,6 +141,12 @@ void RWSplitSession::process_sescmd_response(SRWBackend& backend, GWBUF** ppPack } else { + if (cmd == MYSQL_REPLY_ERR && m_sescmd_responses[id] != MYSQL_REPLY_ERR) + { + MXS_INFO("Session command failed on slave '%s': %s", + backend->name(), extract_error(*ppPacket).c_str()); + } + discard_if_response_differs(backend, m_sescmd_responses[id], cmd, sescmd); }