1
0
Fork 0

Some more fixes

This commit is contained in:
Simon Grätzer 2017-01-16 01:32:14 +01:00
parent c985c00d26
commit 11998b4e5b
2 changed files with 16 additions and 8 deletions

View File

@ -334,26 +334,33 @@ void Conductor::startRecovery() {
basics::ThreadPool* pool = PregelFeature::instance()->threadPool();
pool->enqueue([this] {
// let's wait for a final state in the cluster
for (int i = 0; i < 5; i++) {
// on some systems usleep does not
// like arguments greater than 1000000
usleep(1000000);
// on some systems usleep does not
// like arguments greater than 1000000
usleep(1000000);
usleep(1000000);
if (_state != ExecutionState::RECOVERING) {
return;// seems like we are canceled
}
/*std::vector<ServerID> goodServers;
std::vector<ServerID> goodServers;
int res = PregelFeature::instance()->recoveryManager()->filterGoodServers(
_dbServers, goodServers);
if (res != TRI_ERROR_NO_ERROR) {
LOG(ERR) << "Recovery proceedings failed";
cancel();
return;
}*/
}
_dbServers = goodServers;
VPackBuilder b;
b.openObject();
b.add(Utils::executionNumberKey, VPackValue(_executionNumber));
b.add(Utils::globalSuperstepKey, VPackValue(_globalSuperstep));
b.close();
_sendToAllDBServers(Utils::cancelGSSPath, b.slice());// will fail for some
_sendToAllDBServers(Utils::cancelGSSPath, b.slice());
if (_state != ExecutionState::RECOVERING) {
return;// seems like we are canceled
}
// Let's try recovery
if (_algorithm->supportsCompensation()) {

View File

@ -141,6 +141,7 @@ void RecoveryManager::_monitorShard(DatabaseID const& databaseName,
int RecoveryManager::filterGoodServers(std::vector<ServerID> const& servers,
std::vector<ServerID>& goodServers) {
// TODO I could also use ClusterInfo::failedServers
AgencyCommResult result = _agency.getValues("Supervision/Health");
if (result.successful()) {
VPackSlice serversRegistered =
@ -156,7 +157,7 @@ int RecoveryManager::filterGoodServers(std::vector<ServerID> const& servers,
if (slice.isObject() && slice.hasKey("Status")) {
VPackSlice status = slice.get("Status");
if (status.compareString(
consensus::Supervision::HEALTH_STATUS_GOOD)) {
consensus::Supervision::HEALTH_STATUS_GOOD) == 0) {
ServerID name = serverId.copyString();
if (std::find(servers.begin(), servers.end(), name) !=
servers.end()) {