MXS-3800: Explain lost_slave events
Currently the state change explanations are only added to mariadbmon. They are less relevant for Galera clusters as they themselves explain why they change their states but should still be added to make them easier to analyze. The event that isn't explained and is most often encountered is the loss of a Slave status. Most often the loss of a Slave status happens because either the IO thread or the SQL thread has stopped. Printing the states of the threads as well as the latest error should hint at what caused the outage. The information can be added to the REST API in 2.5 where the monitors can add extra information to the server JSON.
This commit is contained in:
@ -580,6 +580,19 @@ void MariaDBMonitor::process_state_changes()
|
||||
}
|
||||
}
|
||||
|
||||
std::string MariaDBMonitor::annotate_state_change(MonitorServer* server)
|
||||
{
|
||||
std::string rval;
|
||||
|
||||
if (server->get_event_type() == LOST_SLAVE_EVENT)
|
||||
{
|
||||
MariaDBServer* srv = get_server(server);
|
||||
rval = srv->print_changed_slave_connections();
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save info on the master server's multimaster group, if any. This is required when checking for changes
|
||||
* in the topology.
|
||||
|
||||
Reference in New Issue
Block a user