MXS-1446: Store more detailed event information
The timestamp of the last change from passive to active is now tracked. This, with the timestamps of the last master_down and master_up events, allows detection of cases when MaxScale was failed over but the failover was not done. Currently, only a warning is logged if no new master has appeared within 90 seconds of a master_down event and MaxScale was set to active from passive. The last event and when the event was triggered is now shown for all servers. The latest change from passive to active is also shown.
This commit is contained in:
@ -210,6 +210,8 @@ typedef struct
|
||||
unsigned int auth_write_timeout; /**< Write timeout for the user authentication */
|
||||
bool skip_permission_checks; /**< Skip service and monitor permission checks */
|
||||
bool passive; /**< True if MaxScale is in passive mode */
|
||||
int64_t promoted_at; /**< Time when this Maxscale instance was
|
||||
* promoted from a passive to an active */
|
||||
char qc_name[PATH_MAX]; /**< The name of the query classifier to load */
|
||||
char* qc_args; /**< Arguments for the query classifier */
|
||||
qc_sql_mode_t qc_sql_mode; /**< The query classifier sql mode */
|
||||
|
@ -169,7 +169,7 @@ typedef struct monitor_servers
|
||||
int mon_err_count;
|
||||
unsigned int mon_prev_status;
|
||||
unsigned int pending_status; /**< Pending Status flag bitmap */
|
||||
mxs_monitor_event_t last_event; /**< The last event that occurred on this server*/
|
||||
bool new_event; /**< Whether an action was taken on the last event */
|
||||
struct monitor_servers *next; /**< The next server in the list */
|
||||
} MXS_MONITOR_SERVERS;
|
||||
|
||||
@ -205,6 +205,9 @@ 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 */
|
||||
int32_t failover_timeout; /**< Timeout in seconds for failover script */
|
||||
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 */
|
||||
};
|
||||
|
||||
@ -266,6 +269,7 @@ bool mon_print_fail_status(MXS_MONITOR_SERVERS* mon_srv);
|
||||
|
||||
mxs_connect_result_t mon_ping_or_connect_to_db(MXS_MONITOR* mon, MXS_MONITOR_SERVERS *database);
|
||||
void mon_log_connect_error(MXS_MONITOR_SERVERS* database, mxs_connect_result_t rval);
|
||||
const char* mon_get_event_name(mxs_monitor_event_t event);
|
||||
|
||||
void lock_monitor_servers(MXS_MONITOR *monitor);
|
||||
void release_monitor_servers(MXS_MONITOR *monitor);
|
||||
|
@ -135,6 +135,8 @@ typedef struct server
|
||||
uint8_t charset; /**< Default server character set */
|
||||
bool is_active; /**< Server is active and has not been "destroyed" */
|
||||
bool proxy_protocol; /**< Send proxy-protocol header to backend when connecting client sessions. */
|
||||
int last_event; /**< The last event that occurred on this server */
|
||||
int64_t triggered_at; /**< Time when the last event was triggered */
|
||||
#if defined(SS_DEBUG)
|
||||
skygw_chk_t server_chk_tail;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user