MXS-1446: Move failover parameters into mysqlmon
The `failover` and `failover_timeout` parameters are now declared as a part of the mysqlmon module. Changed the implementation of the failover function so that the dependencies on the monitor struct can be removed or moved into parameters.
This commit is contained in:
@ -205,8 +205,6 @@ struct mxs_monitor
|
||||
bool active; /**< True if monitor is active */
|
||||
time_t journal_max_age; /**< Maximum age of journal file */
|
||||
uint32_t script_timeout; /**< Timeout in seconds for the monitor scripts */
|
||||
uint32_t failover_timeout; /**< Timeout in seconds for failover script */
|
||||
bool failover; /**< Whether failover functionality is enabled */
|
||||
int64_t last_master_up; /**< Time when the last master_up event was triggered */
|
||||
int64_t last_master_down; /**< Time when the last master_down event was triggered */
|
||||
struct mxs_monitor *next; /**< Next monitor in the linked list */
|
||||
@ -255,8 +253,6 @@ extern const char CN_BACKEND_CONNECT_TIMEOUT[];
|
||||
extern const char CN_MONITOR_INTERVAL[];
|
||||
extern const char CN_JOURNAL_MAX_AGE[];
|
||||
extern const char CN_SCRIPT_TIMEOUT[];
|
||||
extern const char CN_FAILOVER[];
|
||||
extern const char CN_FAILOVER_TIMEOUT[];
|
||||
extern const char CN_SCRIPT[];
|
||||
extern const char CN_EVENTS[];
|
||||
|
||||
@ -298,12 +294,15 @@ void mon_process_state_changes(MXS_MONITOR *monitor, const char *script, uint64_
|
||||
*
|
||||
* This function should be called immediately after @c mon_process_state_changes.
|
||||
*
|
||||
* @param monitor Monitor whose cluster is processed
|
||||
* @param monitor Monitor whose cluster is processed
|
||||
* @param failover_timeout Timeout in seconds for the failover
|
||||
*
|
||||
* @return True on success, false on error
|
||||
*
|
||||
* @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);
|
||||
bool mon_process_failover(MXS_MONITOR *monitor, uint32_t failover_timeout);
|
||||
|
||||
/**
|
||||
* @brief Hangup connections to failed servers
|
||||
|
Reference in New Issue
Block a user