MXS-2108: Fix open connection calculation

When a connection to a server is lost and the session command history is
disabled, the session will continue as long as at least one connection is
open. Previously the open connection calculation used the same code that
was used when a new session was created which only inspected the
configured server count instead of the actual open connection count.
This commit is contained in:
Markus Mäkelä 2018-10-17 15:32:52 +03:00
parent 6d00dbfc92
commit 192563a947
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -433,14 +433,21 @@ static bool handle_error_new_connection(RWSplit *inst,
}
int max_nslaves = inst->max_slave_count();
bool succp;
bool succp = false;
/**
* Try to get replacement slave or at least the minimum
* number of slave connections for router session.
*/
if (inst->config().disable_sescmd_history)
{
succp = inst->have_enough_servers();
for (auto it = myrses->backends.begin(); it != myrses->backends.end(); it++)
{
if ((*it)->in_use())
{
succp = true;
break;
}
}
}
else
{