From 92b27500c79c6fe41d11c97c9b51596a62e30a1f Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Wed, 23 Jan 2019 16:08:58 +0200 Subject: [PATCH] MXS-2276 Fix things due to MXS_MONITOR -> Monitor change --- server/modules/monitor/clustrixmon/clustrix.cc | 2 +- server/modules/monitor/clustrixmon/clustrix.hh | 4 ++-- .../monitor/clustrixmon/clustrixmonitor.cc | 18 +++++++++--------- .../monitor/clustrixmon/clustrixnode.cc | 2 +- .../monitor/clustrixmon/clustrixnode.hh | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/server/modules/monitor/clustrixmon/clustrix.cc b/server/modules/monitor/clustrixmon/clustrix.cc index b7df1f6e0..6bfd77099 100644 --- a/server/modules/monitor/clustrixmon/clustrix.cc +++ b/server/modules/monitor/clustrixmon/clustrix.cc @@ -154,7 +154,7 @@ bool Clustrix::is_part_of_the_quorum(const SERVER& server, MYSQL* pCon) return rv; } -bool Clustrix::ping_or_connect_to_hub(const MXS_MONITOR& mon, SERVER& server, MYSQL** ppCon) +bool Clustrix::ping_or_connect_to_hub(const Monitor& mon, SERVER& server, MYSQL** ppCon) { bool connected = false; diff --git a/server/modules/monitor/clustrixmon/clustrix.hh b/server/modules/monitor/clustrixmon/clustrix.hh index 8de4238b7..40e501cf4 100644 --- a/server/modules/monitor/clustrixmon/clustrix.hh +++ b/server/modules/monitor/clustrixmon/clustrix.hh @@ -77,7 +77,7 @@ inline bool is_part_of_the_quorum(MXS_MONITORED_SERVER& ms) * * @note Upon return @c *ppCon will be non-NULL. */ -bool ping_or_connect_to_hub(const MXS_MONITOR& mon, SERVER& server, MYSQL** ppCon); +bool ping_or_connect_to_hub(const Monitor& mon, SERVER& server, MYSQL** ppCon); /** * Ping or create connection to server and check whether it can be used @@ -88,7 +88,7 @@ bool ping_or_connect_to_hub(const MXS_MONITOR& mon, SERVER& server, MYSQL** ppCo * * @return True, if the server can be used as hub, false otherwise. */ -inline bool ping_or_connect_to_hub(const MXS_MONITOR& mon, MXS_MONITORED_SERVER& ms) +inline bool ping_or_connect_to_hub(const Monitor& mon, MXS_MONITORED_SERVER& ms) { return ping_or_connect_to_hub(mon, *ms.server, &ms.con); } diff --git a/server/modules/monitor/clustrixmon/clustrixmonitor.cc b/server/modules/monitor/clustrixmon/clustrixmonitor.cc index d40cd9e81..efcb5bf38 100644 --- a/server/modules/monitor/clustrixmon/clustrixmonitor.cc +++ b/server/modules/monitor/clustrixmon/clustrixmonitor.cc @@ -115,7 +115,7 @@ void ClustrixMonitor::choose_hub() auto& element = *it; ClustrixNode& node = element.second; - if (node.can_be_used_as_hub(*m_monitor)) + if (node.can_be_used_as_hub(*this)) { pHub_con = node.release_connection(); pHub_server = node.server(); @@ -129,8 +129,8 @@ void ClustrixMonitor::choose_hub() // If that fails, then we check the bootstrap servers, but only if // it was not checked above. - auto b = begin(*(m_monitor->monitored_servers)); - auto e = end(*(m_monitor->monitored_servers)); + auto b = begin(*(this->monitored_servers)); + auto e = end(*(this->monitored_servers)); for (auto it = b; !pHub_con && (it != e); ++it) { @@ -138,7 +138,7 @@ void ClustrixMonitor::choose_hub() if (ips.find(ms.server->address) == ips.end()) { - if (Clustrix::ping_or_connect_to_hub(*m_monitor, ms)) + if (Clustrix::ping_or_connect_to_hub(*this, ms)) { pHub_con = ms.con; pHub_server = ms.server; @@ -342,7 +342,7 @@ void ClustrixMonitor::check_hub() mxb_assert(m_pHub_con); mxb_assert(m_pHub_server); - if (!Clustrix::ping_or_connect_to_hub(*m_monitor, *m_pHub_server, &m_pHub_con)) + if (!Clustrix::ping_or_connect_to_hub(*this, *m_pHub_server, &m_pHub_con)) { mysql_close(m_pHub_con); m_pHub_con = nullptr; @@ -444,10 +444,10 @@ bool ClustrixMonitor::check_cluster_membership(std::map void ClustrixMonitor::update_server_statuses() { - mxb_assert(m_monitor->monitored_servers); + mxb_assert(this->monitored_servers); - auto b = std::begin(*m_monitor->monitored_servers); - auto e = std::end(*m_monitor->monitored_servers); + auto b = std::begin(*this->monitored_servers); + auto e = std::end(*this->monitored_servers); for_each(b, e, [this](MXS_MONITORED_SERVER& ms) { @@ -506,7 +506,7 @@ void ClustrixMonitor::initiate_delayed_http_check() { mxb_assert(m_delayed_http_check_id == 0); - long max_delay_ms = m_monitor->interval / 10; + long max_delay_ms = this->interval / 10; long ms = m_http.wait_no_more_than(); diff --git a/server/modules/monitor/clustrixmon/clustrixnode.cc b/server/modules/monitor/clustrixmon/clustrixnode.cc index 09fd20a5c..0027b5f54 100644 --- a/server/modules/monitor/clustrixmon/clustrixnode.cc +++ b/server/modules/monitor/clustrixmon/clustrixnode.cc @@ -14,7 +14,7 @@ #include "clustrixnode.hh" #include "clustrix.hh" -bool ClustrixNode::can_be_used_as_hub(const MXS_MONITOR& mon) +bool ClustrixNode::can_be_used_as_hub(const Monitor& mon) { mxb_assert(m_pServer); diff --git a/server/modules/monitor/clustrixmon/clustrixnode.hh b/server/modules/monitor/clustrixmon/clustrixnode.hh index 119500f09..47a2a00d5 100644 --- a/server/modules/monitor/clustrixmon/clustrixnode.hh +++ b/server/modules/monitor/clustrixmon/clustrixnode.hh @@ -160,7 +160,7 @@ public: m_pServer->is_active = false; } - bool can_be_used_as_hub(const MXS_MONITOR& mon); + bool can_be_used_as_hub(const Monitor& mon); SERVER* server() const {