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.
This commit is contained in:
Markus Mäkelä 2018-10-15 13:35:27 +03:00
parent de653437b2
commit 92057f6ff9
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -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
{