MXS-2219 Update datastructures instead of recreating them

The node infos of the Clustrix servers are now kept around and
and updated based upon changing conditions instead of regularly
being re-created.

Further, the server is now looked up by name only right after
having been created (and that only due to runtime_create_server()
currently being used).

The state of the dynamically created server is now updated directly
as a result of the health-check ping, while the state of the bootstrap
servers is updated during the tick()-call according to the monitor
"protocol".
This commit is contained in:
Johan Wikman
2019-01-15 15:47:03 +02:00
parent 0d1743c76b
commit f7c840df26
3 changed files with 100 additions and 42 deletions

View File

@ -13,6 +13,7 @@
#pragma once
#include "clustrixmon.hh"
#include <map>
#include <maxscale/monitor.hh>
#include <maxbase/http.hh>
#include "clustrixnodeinfo.hh"
@ -85,12 +86,12 @@ private:
}
private:
Config m_config;
std::vector<std::string> m_config_servers;
std::vector<ClustrixNodeInfo> m_node_infos;
std::vector<std::string> m_health_urls;
mxb::http::Async m_http;
uint32_t m_delayed_http_check_id { 0 };
long m_last_cluster_check { 0 };
MXS_MONITORED_SERVER* m_pMonitored_server { nullptr };
Config m_config;
std::vector<std::string> m_config_servers;
std::map<int, ClustrixNodeInfo> m_node_infos;
std::vector<std::string> m_health_urls;
mxb::http::Async m_http;
uint32_t m_delayed_http_check_id { 0 };
long m_last_cluster_check { 0 };
MXS_MONITORED_SERVER* m_pMonitored_server { nullptr };
};