From cf338d0158fb8fc1894a875903eaa2dcc7ca40b2 Mon Sep 17 00:00:00 2001 From: Kaveh Vahedipour Date: Mon, 13 Jun 2016 14:45:29 +0200 Subject: [PATCH] shrinkCluster tests --- arangod/Agency/Supervision.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/arangod/Agency/Supervision.cpp b/arangod/Agency/Supervision.cpp index 2aa857e368..6168fa6e99 100644 --- a/arangod/Agency/Supervision.cpp +++ b/arangod/Agency/Supervision.cpp @@ -165,7 +165,8 @@ std::vector Supervision::checkDBServers() { del->openArray(); del->openObject(); for (auto const& srv : todelete) { - del->add(_agencyPrefix + healthPrefix + srv, VPackValue(VPackValueType::Object)); + del->add(_agencyPrefix + healthPrefix + srv, + VPackValue(VPackValueType::Object)); del->add("op", VPackValue("delete")); del->close(); } @@ -273,7 +274,8 @@ std::vector Supervision::checkCoordinators() { del->openArray(); del->openObject(); for (auto const& srv : todelete) { - del->add(_agencyPrefix + healthPrefix + srv, VPackValue(VPackValueType::Object)); + del->add(_agencyPrefix + healthPrefix + srv, + VPackValue(VPackValueType::Object)); del->add("op", VPackValue("delete")); del->close(); } @@ -450,7 +452,8 @@ void Supervision::shrinkCluster () { // Minimum 1 DB server must remain if (availServers.size() == 1) { - LOG_TOPIC(DEBUG, Logger::AGENCY) << "Only one db server left for operation"; + LOG_TOPIC(DEBUG, Logger::AGENCY) << + "Only one db server left for operation"; return; } @@ -465,8 +468,8 @@ void Supervision::shrinkCluster () { maxReplFact = replFact; } } catch (std::exception const& e) { - LOG_TOPIC(DEBUG, Logger::AGENCY) << - "Cannot retrieve replication factor for collection " << collptr.first; + LOG_TOPIC(DEBUG, Logger::AGENCY) << "Cannot retrieve replication " << + "factor for collection " << collptr.first; return; } } @@ -537,7 +540,7 @@ void Supervision::getUniqueIds() { while (!this->isStopping()) { try { latestId = std::stoul( - _agent->readDB().get(_agencyPrefix + "/Sync/LatestID").slice().toJson()); + _agent->readDB().get(_agencyPrefix + "/Sync/LatestID").slice().toJson()); } catch (...) { std::this_thread::sleep_for (std::chrono::seconds(1)); continue;