diff --git a/arangod/Agency/AgentConfiguration.h b/arangod/Agency/AgentConfiguration.h index 492a976ba5..9d36b55626 100644 --- a/arangod/Agency/AgentConfiguration.h +++ b/arangod/Agency/AgentConfiguration.h @@ -197,12 +197,6 @@ struct config_t { /// @brief Update an indivdual uuid's endpoint bool updateEndpoint(std::string const&, std::string const&); -private: - /// @brief Get replacement for deceased active agent - bool swapActiveMemberNoLock(std::string const&, std::string const&); - - - }; } } diff --git a/arangod/Agency/RestAgencyHandler.cpp b/arangod/Agency/RestAgencyHandler.cpp index 1309d81d3a..7f673e0584 100644 --- a/arangod/Agency/RestAgencyHandler.cpp +++ b/arangod/Agency/RestAgencyHandler.cpp @@ -419,6 +419,8 @@ inline RestStatus RestAgencyHandler::handleRead() { } RestStatus RestAgencyHandler::handleConfig() { + + // Update endpoint of peer if (_request->requestType() == rest::RequestType::POST) { try { arangodb::velocypack::Options options; @@ -429,15 +431,20 @@ RestStatus RestAgencyHandler::handleConfig() { return RestStatus::DONE; } } + + // Respond with configuration Builder body; - body.add(VPackValue(VPackValueType::Object)); - body.add("term", Value(_agent->term())); - body.add("leaderId", Value(_agent->leaderID())); - body.add("lastCommitted", Value(_agent->lastCommitted())); - body.add("lastAcked", _agent->lastAckedAgo()->slice()); - body.add("configuration", _agent->config().toBuilder()->slice()); - body.close(); + { + VPackObjectBuilder b(&body); + body.add("term", Value(_agent->term())); + body.add("leaderId", Value(_agent->leaderID())); + body.add("lastCommitted", Value(_agent->lastCommitted())); + body.add("lastAcked", _agent->lastAckedAgo()->slice()); + body.add("configuration", _agent->config().toBuilder()->slice()); + } + generateResult(rest::ResponseCode::OK, body.slice()); + return RestStatus::DONE; }