Better tracking for slave status bits

The monitor can now differentiate between slaves with a running
series of slave connections to the master from slaves with broken
links. Both still get the SERVER_SLAVE-flag if 'detect_stale_slave'
is on.

Also, relay servers must be running.
This commit is contained in:
Esa Korhonen
2018-07-23 20:06:15 +03:00
parent 3be975ba5d
commit 89dfc80f86
4 changed files with 147 additions and 116 deletions

View File

@ -465,19 +465,7 @@ void MariaDBMonitor::tick()
// Always re-assign master, slave etc bits as these depend on other factors outside topology
// (e.g. slave sql state).
assign_master_and_slave();
if (!m_ignore_external_masters)
{
// Do a sweep through all the nodes in the cluster (even the master) and mark external slaves.
for (MariaDBServer* server : m_servers)
{
if (!server->m_node.external_masters.empty())
{
server->set_status(SERVER_SLAVE_OF_EXT_MASTER);
}
}
}
assign_server_roles();
if (m_master != NULL && m_master->is_master())
{