1
0
Fork 0

looks good for dangling creation of shards

This commit is contained in:
Kaveh Vahedipour 2016-09-05 11:03:37 +02:00
parent f0023d70e1
commit f066ff9920
2 changed files with 15 additions and 1 deletions

View File

@ -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;
}

View File

@ -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);
}
}