Check IO thread status when verifying master failure

When MaxScale thinks that the master has failed, it tries to verify it by
seeing if the slave server is receiving events. There was a missing IO
thread status check in the slave_receiving_events function which caused
the failover to wait until the verification timed out.

The relay master detection logic also lacked a check for the slave SQL
thread status. The code should check the state of the SQL thread to
determine whether the server is actually a functional slave to a master.
This commit is contained in:
Markus Mäkelä
2018-03-08 20:56:43 +02:00
parent 4c7edc1b68
commit f7b284bbb7

View File

@ -1521,6 +1521,7 @@ static bool slave_receiving_events(MYSQL_MONITOR* handle)
MySqlServerInfo* info = get_server_info(handle, server);
if (info->slave_configured &&
info->slave_status.slave_io_running &&
info->slave_status.master_server_id == master_id &&
difftime(time(NULL), info->latest_event) < handle->master_failure_timeout)
{