Log latest error on broken master connection

When the master goes down, log the latest error if one is present.
This commit is contained in:
Markus Mäkelä 2020-02-06 08:35:04 +02:00
parent 4a725da940
commit 791d2ade99
No known key found for this signature in database
GPG Key ID: 5CE746D557ACC499

View File

@ -1148,10 +1148,11 @@ void RWSplitSession::handleError(GWBUF* errmsgbuf,
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. "
"Last close reason: %s",
"Last close reason: %s. Last error: %s",
backend->name(), errmsg.c_str(), (float)idle / 10.f,
extract_error(errmsgbuf).c_str(),
backend->close_reason().empty() ? "<none>" : backend->close_reason().c_str());
backend->close_reason().empty() ? "<none>" : backend->close_reason().c_str(),
backend->error().message().c_str());
}
// Decrement the expected response count only if we know we can continue the sesssion.