Check if master reference is disabled

If a Backend is closed, the associated DCB is no longer valid. This needs
to be taken into account when the stored master reference is used.
This commit is contained in:
Markus Mäkelä
2018-01-08 10:55:32 +02:00
parent 336a508cda
commit e5d9ca4af8
3 changed files with 7 additions and 6 deletions

View File

@ -1294,7 +1294,8 @@ static void handleError(MXS_ROUTER *instance,
{
case ERRACT_NEW_CONNECTION:
{
if (rses->current_master && rses->current_master->dcb() == problem_dcb)
if (rses->current_master && rses->current_master->in_use() &&
rses->current_master->dcb() == problem_dcb)
{
/** The connection to the master has failed */
SERVER *srv = rses->current_master->server();