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:
@ -292,6 +292,10 @@ static void handle_error_reply_client(MXS_SESSION *ses, RWSplitSession *rses,
|
|||||||
CHK_DCB(client_dcb);
|
CHK_DCB(client_dcb);
|
||||||
client_dcb->func.write(client_dcb, gwbuf_clone(errmsg));
|
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)
|
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)
|
if (rses->rses_closed)
|
||||||
{
|
{
|
||||||
|
ss_dassert(!true);
|
||||||
*succp = false;
|
*succp = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1399,6 +1404,8 @@ static void handleError(MXS_ROUTER *instance,
|
|||||||
* Reset the target and close the session. */
|
* Reset the target and close the session. */
|
||||||
rses->target_node.reset();
|
rses->target_node.reset();
|
||||||
*succp = false;
|
*succp = false;
|
||||||
|
MXS_ERROR("Connection to server %s failed while executing a read-only transaction",
|
||||||
|
backend->name());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user