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

@ -271,8 +271,8 @@ inline bool server_is_master(const SERVER* server)
inline bool status_is_slave(uint64_t status)
{
return (status & (SERVER_RUNNING | SERVER_SLAVE | SERVER_MAINT)) ==
(SERVER_RUNNING | SERVER_SLAVE);
return ((status & (SERVER_RUNNING | SERVER_MAINT)) == SERVER_RUNNING) &&
((status & SERVER_SLAVE) || (status & SERVER_WAS_SLAVE));
}
/**