Make MySQL monitor crash-safe

The MySQL monitor stores the server states in a backup file which can be
used to restore the state of the servers even if MaxScale is stoppen in an
uncontrolled fashion.
This commit is contained in:
Markus Mäkelä
2017-03-16 10:58:50 +02:00
parent 7165b4306f
commit 08cc7a9515
4 changed files with 453 additions and 1 deletions

View File

@ -79,8 +79,30 @@ typedef struct
down before failover is initiated */
bool allow_cluster_recovery; /**< Allow failed servers to rejoin the cluster */
bool warn_failover; /**< Log a warning when failover happens */
bool load_backup; /**< Whether backup file should be loaded */
} MYSQL_MONITOR;
/**
* @brief Store a backup of server states
*
* @param monitor Monitor to backup
*/
void store_server_backup(MXS_MONITOR *monitor);
/**
* @brief Load a backup of server states
*
* @param monitor Monitor where backup is loaded
*/
void load_server_backup(MXS_MONITOR *monitor);
/**
* @brief Remove stored backup file
*
* @param monitor Monitor whose backup is removed
*/
void remove_server_backup(MXS_MONITOR *monitor);
MXS_END_DECLS
#endif