Fix slave reconnection logic

Allowing calls to select_connect_backend_servers even when all slaves are
connected solves the debug assertion in select_connect_backend_servers
that happens when the execution of a queued query causes a new connection
to be created.
This commit is contained in:
Markus Mäkelä
2018-06-13 12:44:09 +03:00
parent 3ed6411741
commit 2005164222
4 changed files with 27 additions and 13 deletions

View File

@ -681,6 +681,7 @@ void RWSplitSession::handleError(GWBUF *errmsgbuf, DCB *problem_dcb,
if (m_current_master && m_current_master->in_use() && m_current_master == backend)
{
MXS_INFO("Master '%s' failed", backend->name());
/** The connection to the master has failed */
if (!backend->is_waiting_result())
@ -739,6 +740,7 @@ void RWSplitSession::handleError(GWBUF *errmsgbuf, DCB *problem_dcb,
}
else
{
MXS_INFO("Slave '%s' failed", backend->name());
if (m_target_node && m_target_node == backend &&
session_trx_is_read_only(problem_dcb->session))
{