MXS-1446: Move failover to mysqlmon

Split the state change processing and failover handling into two separate
functions and added a call to the failover function into mysqlmon. This
prevents unintended behavior when failover is enabled for non-mysqlmon
monitors. The parameter itself still needs to be moved into mysqlmon.

Moved the failover documentation to the mysqlmon documentation as it is
specific to this monitor.
This commit is contained in:
Markus Mäkelä
2017-09-28 07:54:42 +03:00
parent 0d6c06f33d
commit ef115208e6
5 changed files with 84 additions and 23 deletions

View File

@ -289,6 +289,22 @@ void release_monitor_servers(MXS_MONITOR *monitor);
*/
void mon_process_state_changes(MXS_MONITOR *monitor, const char *script, uint64_t events);
/**
* @brief Process possible failover event
*
* If a master failure has occurred and MaxScale is configured with failover
* functionality, this fuction executes an external failover program to elect
* a new master server.
*
* This function should be called immediately after @c mon_process_state_changes.
*
* @param monitor Monitor whose cluster is processed
*
* @todo Currently this only works with flat replication topologies and
* needs to be moved inside mysqlmon as it is MariaDB specific code.
*/
void mon_process_failover(MXS_MONITOR *monitor);
/**
* @brief Hangup connections to failed servers
*