Don't use closed backends

Only use backends that are still in use. The COM_STMT_EXECUTE and
COM_STMT_FETCH relationship caused unused backends to be used.
This commit is contained in:
Markus Mäkelä
2018-06-26 12:45:08 +03:00
parent d5bdc3febd
commit f97f422379
2 changed files with 13 additions and 2 deletions

View File

@ -999,8 +999,15 @@ SRWBackend handle_slave_is_target(RWSplit *inst, RWSplitSession *rses,
if (it != rses->exec_map.end())
{
target = it->second;
MXS_INFO("COM_STMT_FETCH on %s", target->uri());
if (it->second->in_use())
{
target = it->second;
MXS_INFO("COM_STMT_FETCH on %s", target->uri());
}
else
{
MXS_INFO("Old target not in use, cannot proceed");
}
}
else
{
@ -1016,6 +1023,7 @@ SRWBackend handle_slave_is_target(RWSplit *inst, RWSplitSession *rses,
if (target)
{
atomic_add_uint64(&inst->stats().n_slave, 1);
ss_dassert(target->in_use());
}
else
{