From f066ff99204017b9d7f0b390a5712d1a210c5ee8 Mon Sep 17 00:00:00 2001 From: Kaveh Vahedipour Date: Mon, 5 Sep 2016 11:03:37 +0200 Subject: [PATCH] looks good for dangling creation of shards --- arangod/Agency/CleanOutServer.cpp | 13 +++++++++++++ arangod/Agency/FailedServer.cpp | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/arangod/Agency/CleanOutServer.cpp b/arangod/Agency/CleanOutServer.cpp index 33cf133269..0e34ee7ecd 100644 --- a/arangod/Agency/CleanOutServer.cpp +++ b/arangod/Agency/CleanOutServer.cpp @@ -355,6 +355,18 @@ bool CleanOutServer::checkFeasibility () { } } + // Server has not been cleaned already + if (_snapshot.exists("/Target/FailedServers").size() == 2) { + for (auto const& srv : + VPackArrayIterator(_snapshot("/Failed/CleanedServers").slice())) { + if (srv.copyString() == _server) { + LOG_TOPIC(ERR, Logger::AGENCY) + << _server << " has been cleaned out already!"; + return false; + } + } + } + if (_snapshot.exists(serverStatePrefix + _server + "/cleaning").size() == 4) { LOG_TOPIC(ERR, Logger::AGENCY) << _server << " has been cleaned out already!"; @@ -431,3 +443,4 @@ bool CleanOutServer::checkFeasibility () { return true; } + diff --git a/arangod/Agency/FailedServer.cpp b/arangod/Agency/FailedServer.cpp index 234d4993d1..b98251cc7f 100644 --- a/arangod/Agency/FailedServer.cpp +++ b/arangod/Agency/FailedServer.cpp @@ -167,7 +167,8 @@ bool FailedServer::start() { for (auto const& shard : collection("shards").children()) { UnassumedLeadership( _snapshot, _agent, _jobId + "-" + std::to_string(sub++), _jobId, - _agencyPrefix, database.first, collptr.first, shard.first); + _agencyPrefix, database.first, collptr.first, shard.first, + _server); } }