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
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -1012,21 +1012,11 @@ void RWSplitSession::handleError(GWBUF* errmsgbuf,
if (!can_continue)
{
if (!backend->is_master() && !backend->server()->master_err_is_logged)
{
MXS_ERROR("Server %s (%s) lost the master status while waiting"
" for a result. Client sessions will be closed.",
backend->name(),
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());
}
int64_t idle = mxs_clock() - backend->dcb()->last_read;
MXS_ERROR("Lost connection to the master server '%s', closing session.%s "
"Connection has been idle for %.1f seconds. Error caused by: %s",
backend->name(), 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.