Factor out functions

The topology update is now in a method. Also, the m_master-field
is only written inside a method so that the cycle info is always
updated.
This commit is contained in:
Esa Korhonen
2018-07-03 14:45:37 +03:00
parent 936bcde135
commit f2e0bf3caa
3 changed files with 92 additions and 73 deletions

View File

@ -100,6 +100,7 @@ public:
protected:
void pre_loop();
void tick();
void process_state_changes();
private:
@ -192,6 +193,7 @@ private:
// Cluster discovery and status assignment methods
void update_server(MariaDBServer& server);
void find_graph_cycles();
void update_topology();
void log_master_changes();
void update_gtid_domain();
void update_external_master();
@ -211,6 +213,7 @@ private:
bool cycle_has_master_server(ServerArray& cycle_servers);
void update_master_cycle_info();
void set_low_disk_slaves_maintenance();
void assign_new_master(MariaDBServer* new_master);
// Switchover methods
bool manual_switchover(SERVER* new_master, SERVER* current_master, json_t** error_out);