MXS-2151: Always log fatal master connection errors

When the connection to the master is broken, the session is not configured
to use the read-only modes and the monitor can still connect to the
server, the connection will be closed and and error is sent to the
client. To leave some trace of this problem in the MaxScale logs, a
message should always be logged when a network error occurs.
This commit is contained in:
Markus Mäkelä 2018-11-09 00:39:32 +02:00
parent 6a8ba999bd
commit bfc8cb4803
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -441,13 +441,19 @@ static bool handle_error_new_connection(RWSplit *inst,
if (inst->config().disable_sescmd_history)
{
for (auto it = myrses->backends.begin(); it != myrses->backends.end(); it++)
{
if ((*it)->in_use())
{
succp = true;
break;
}
}
{
if ((*it)->in_use())
{
succp = true;
break;
}
}
if (!succp)
{
MXS_ERROR("Unable to continue session as all connections have failed, "
"last server to fail was '%s'.", backend->name());
}
}
else
{
@ -1388,6 +1394,10 @@ static void handleError(MXS_ROUTER *instance,
"will be closed.", srv->name, srv->port);
srv->master_err_is_logged = true;
}
else
{
MXS_ERROR("Lost connection to the master server, closing session.");
}
*succp = can_continue;