MXS-1643: Make Master and Slave status mutually exclusive
The Master status now prevents Slave status from being assigned to a server. In practice this simply means that the master will not have both the Master and Slave status bits.
This commit is contained in:
@ -2303,9 +2303,10 @@ monitorMain(void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (root_master)
|
if (root_master && SERVER_IS_MASTER(root_master->server))
|
||||||
{
|
{
|
||||||
// Clear slave and stale slave status bits from current master
|
// Clear slave and stale slave status bits from current master
|
||||||
|
server_clear_status_nolock(root_master->server, SERVER_SLAVE | SERVER_STALE_SLAVE);
|
||||||
monitor_clear_pending_status(root_master, SERVER_SLAVE | SERVER_STALE_SLAVE);
|
monitor_clear_pending_status(root_master, SERVER_SLAVE | SERVER_STALE_SLAVE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2323,6 +2324,10 @@ monitorMain(void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ss_dassert(handle->master == root_master);
|
||||||
|
ss_dassert((root_master->server->status & (SERVER_SLAVE | SERVER_MASTER))
|
||||||
|
!= (SERVER_SLAVE | SERVER_MASTER));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* After updating the status of all servers, check if monitor events
|
* After updating the status of all servers, check if monitor events
|
||||||
* need to be launched.
|
* need to be launched.
|
||||||
|
Reference in New Issue
Block a user