mirror of https://gitee.com/bigwinds/arangodb
nolock swap active member in agent configuration not needed
This commit is contained in:
parent
bd28896b69
commit
202f0636df
|
@ -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&);
|
||||
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue