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:
parent
6d00dbfc92
commit
192563a947
@ -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
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user