Merge branch '2.3' into 2.4

This commit is contained in:
Markus Mäkelä
2019-07-18 12:49:00 +03:00
5 changed files with 55 additions and 36 deletions

View File

@ -415,8 +415,6 @@ json_t* RWSplit::diagnostics_json() const
for (const auto& a : all_server_stats())
{
mxb_assert(a.second.total == a.second.read + a.second.write);
ServerStats::CurrentStats stats = a.second.current_stats();
json_t* obj = json_object();

View File

@ -1027,7 +1027,6 @@ void RWSplitSession::handleError(GWBUF* errmsgbuf,
{
// We were expecting a response but we aren't going to get one
mxb_assert(m_expected_responses > 0);
m_expected_responses--;
errmsg += " Lost connection to master server while waiting for a result.";
if (can_retry_query())
@ -1042,6 +1041,14 @@ void RWSplitSession::handleError(GWBUF* errmsgbuf,
can_continue = true;
send_readonly_error(m_client);
}
// Decrement the expected response count only if we know we can continue the sesssion.
// This keeps the internal logic sound even if another query is routed before the session
// is closed.
if (can_continue)
{
m_expected_responses--;
}
}
if (session_trx_is_active(session) && m_otrx_state == OTRX_INACTIVE)