Improve master failure error message

The message will now always contain the server name.
This commit is contained in:
Markus Mäkelä
2019-08-01 16:52:41 +03:00
parent 84a1578f4b
commit fd72332ea4

View File

@ -1012,21 +1012,11 @@ void RWSplitSession::handleError(GWBUF* errmsgbuf,
if (!can_continue) if (!can_continue)
{ {
if (!backend->is_master() && !backend->server()->master_err_is_logged) int64_t idle = mxs_clock() - backend->dcb()->last_read;
{ MXS_ERROR("Lost connection to the master server '%s', closing session.%s "
MXS_ERROR("Server %s (%s) lost the master status while waiting" "Connection has been idle for %.1f seconds. Error caused by: %s",
" for a result. Client sessions will be closed.", backend->name(), errmsg.c_str(), (float)idle / 10.f,
backend->name(), extract_error(errmsgbuf).c_str());
backend->uri());
backend->server()->master_err_is_logged = true;
}
else
{
int64_t idle = mxs_clock() - backend->dcb()->last_read;
MXS_ERROR("Lost connection to the master server, closing session.%s "
"Connection has been idle for %.1f seconds. Error caused by: %s",
errmsg.c_str(), (float)idle / 10.f, extract_error(errmsgbuf).c_str());
}
} }
// Decrement the expected response count only if we know we can continue the sesssion. // Decrement the expected response count only if we know we can continue the sesssion.