1
0
Fork 0

waitFor will report more paranoid

This commit is contained in:
Kaveh Vahedipour 2017-01-10 10:38:18 +01:00
parent adf3778f34
commit 150ff8a1e3
2 changed files with 10 additions and 1 deletions

View File

@ -178,7 +178,7 @@ bool Agent::waitFor(index_t index, double timeout) {
// timeout
if (!_waitForCV.wait(static_cast<uint64_t>(1.0e6 * timeout))) {
return false;
return (_lastCommitIndex >= index);
}
// shutting down

View File

@ -935,6 +935,7 @@ int ClusterInfo::createDatabaseCoordinator(std::string const& name,
}
if (TRI_microtime() > endTime) {
return setErrormsg(TRI_ERROR_CLUSTER_TIMEOUT, errorMsg);
}
@ -1012,6 +1013,14 @@ int ClusterInfo::dropDatabaseCoordinator(std::string const& name,
}
if (TRI_microtime() > endTime) {
AgencyCommResult ag = ac.getValues("/");
if (ag.successful()) {
LOG_TOPIC(ERR, Logger::CLUSTER) << "Agency dump:\n"
<< ag.slice().toJson();
} else {
LOG_TOPIC(ERR, Logger::CLUSTER) << "Could not get agency dump!";
}
return setErrormsg(TRI_ERROR_CLUSTER_TIMEOUT, errorMsg);
}