Only write to SERVER->status at the end of a monitoring loop
This makes the code clearer and reduces race conditions, as the monitor could be writing SERVER->status while a router is reading it. Also, the time during which the SERVER struct is locked drops to a fraction.
This commit is contained in:
@ -201,7 +201,7 @@ private:
|
||||
bool switchover_check(SERVER* new_master, SERVER* current_master,
|
||||
MariaDBServer** new_master_out, MariaDBServer** current_master_out,
|
||||
json_t** error_out);
|
||||
bool switchover_check_new(const MXS_MONITORED_SERVER* monitored_server, json_t** error);
|
||||
bool switchover_check_new(const MariaDBServer* new_master_cand, json_t** error);
|
||||
bool switchover_check_current(const MXS_MONITORED_SERVER* suggested_curr_master,
|
||||
json_t** error_out) const;
|
||||
bool do_switchover(MariaDBServer** current_master, MariaDBServer** new_master, json_t** err_out);
|
||||
|
Reference in New Issue
Block a user