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:
@ -87,6 +87,17 @@ json_t* SlaveStatus::to_json() const
|
||||
return result;
|
||||
}
|
||||
|
||||
bool SlaveStatus::equal(const SlaveStatus& rhs) const
|
||||
{
|
||||
// Strictly speaking, the following should depend on the 'assume_unique_hostnames',
|
||||
// but the situations it would make a difference are so rare they can be ignored.
|
||||
return slave_io_running == rhs.slave_io_running
|
||||
&& slave_sql_running == rhs.slave_sql_running
|
||||
&& settings.master_endpoint == rhs.settings.master_endpoint
|
||||
&& settings.name == rhs.settings.name
|
||||
&& master_server_id == rhs.master_server_id;
|
||||
}
|
||||
|
||||
SlaveStatus::slave_io_running_t SlaveStatus::slave_io_from_string(const std::string& str)
|
||||
{
|
||||
slave_io_running_t rval = SLAVE_IO_NO;
|
||||
|
||||
Reference in New Issue
Block a user