From 97a4cdcd49700f91ddf54cbcbb9cc60fe7fa226e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Sat, 15 Sep 2018 23:15:05 +0300 Subject: [PATCH] MXS-2052: Log error on failed routing of session command If no server receives the session command, an error is now logged. --- .../modules/routing/readwritesplit/rwsplit_route_stmt.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc b/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc index cc5ed2e19..b8296790f 100644 --- a/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc +++ b/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc @@ -357,6 +357,7 @@ bool route_session_write(RWSplitSession *rses, GWBUF *querybuf, } MXS_INFO("Session write, routing to all servers."); + bool attempted_write = false; for (SRWBackendList::iterator it = rses->backends.begin(); it != rses->backends.end(); it++) @@ -365,6 +366,7 @@ bool route_session_write(RWSplitSession *rses, GWBUF *querybuf, if (backend->in_use()) { + attempted_write = true; backend->append_session_command(sescmd); uint64_t current_pos = backend->next_session_command()->get_position(); @@ -433,6 +435,11 @@ bool route_session_write(RWSplitSession *rses, GWBUF *querybuf, rses->recv_sescmd++; } } + else + { + MXS_ERROR("Could not route session command: %s", attempted_write ? "Write to all backends failed" : + "All connections have failed"); + } return nsucc; }