MXS-3089: Close backend on failed session command

This correctly triggers the session command response processing to accept
results from other servers than the current master backend if the session
can continue. If the session cannot continue, it will be stopped
immediately.
This commit is contained in:
Markus Mäkelä
2020-07-23 09:17:01 +03:00
parent cf1d1178d7
commit aaec73a8c8

View File

@ -530,9 +530,19 @@ bool RWSplitSession::route_session_write(GWBUF* querybuf, uint8_t command, uint3
}
else
{
MXS_ERROR("Failed to execute session command in %s (%s)",
backend->name(),
backend->uri());
backend->close();
if (m_config.master_failure_mode == RW_FAIL_INSTANTLY && backend == m_current_master)
{
MXS_ERROR("Failed to execute session command in Master: %s (%s)",
backend->name(), backend->uri());
return false;
}
else
{
MXS_ERROR("Failed to execute session command in %s (%s)",
backend->name(), backend->uri());
}
}
}
}