mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of ssh://github.com/ArangoDB/ArangoDB into devel
This commit is contained in:
commit
9e3c9e3469
|
@ -42,7 +42,7 @@ if (WIN32 AND NOT SSL_NUGET)
|
|||
set(OPENSSL_EXT "")
|
||||
endif ()
|
||||
|
||||
if (NOT ${OPENSSL_LIB_DIR)
|
||||
if (NOT ${OPENSSL_LIB_DIR})
|
||||
set(OPENSSL_LIB_DIR "${OPENSSL_ROOT_DIR}/lib/VC")
|
||||
endif ()
|
||||
|
||||
|
|
|
@ -143,11 +143,11 @@ struct Job {
|
|||
|
||||
virtual bool start() const = 0;
|
||||
|
||||
Node const& _snapshot;
|
||||
Node _snapshot;
|
||||
Agent* _agent;
|
||||
std::string const _jobId;
|
||||
std::string const& _creator;
|
||||
std::string const& _agencyPrefix;
|
||||
std::string _jobId;
|
||||
std::string _creator;
|
||||
std::string _agencyPrefix;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -128,11 +128,9 @@ bool MoveShard::start() const {
|
|||
LOG_TOPIC(INFO, Logger::AGENCY)
|
||||
<< "Pending: Move shard " + _shard + " from " + _from + " to " << _to;
|
||||
|
||||
Builder todo, pending;
|
||||
|
||||
// Copy todo to pending
|
||||
/* Builder todo, pending;
|
||||
|
||||
Builder todo, pending;
|
||||
/*
|
||||
// Get todo entry
|
||||
todo.openArray();
|
||||
_snapshot(toDoPrefix + _jobId).toBuilder(todo);
|
||||
|
@ -214,10 +212,10 @@ bool MoveShard::start() const {
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
*/
|
||||
LOG_TOPIC(INFO, Logger::AGENCY) <<
|
||||
"Precondition failed for starting job " + _jobId;
|
||||
*/
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
|
|
@ -296,7 +296,7 @@ bool State::loadCompacted() {
|
|||
|
||||
VPackSlice result = queryResult.result->slice();
|
||||
|
||||
if (result.isArray()) {
|
||||
if (result.isArray() && result.length()) {
|
||||
for (auto const& i : VPackArrayIterator(result)) {
|
||||
buffer_t tmp = std::make_shared<arangodb::velocypack::Buffer<uint8_t>>();
|
||||
(*_agent) = i;
|
||||
|
|
|
@ -138,6 +138,10 @@ Store::~Store() {}
|
|||
std::vector<bool> Store::apply(query_t const& query) {
|
||||
std::vector<bool> applied;
|
||||
MUTEX_LOCKER(storeLocker, _storeLock);
|
||||
/*for (auto const& i : VPackArrayIterator(query->slice())) {
|
||||
LOG(WARN) << i[0].typeName();
|
||||
LOG(WARN) << i[0].keyAt(0).copyString();
|
||||
} */
|
||||
for (auto const& i : VPackArrayIterator(query->slice())) {
|
||||
switch (i.length()) {
|
||||
case 1:
|
||||
|
|
|
@ -66,7 +66,7 @@ static std::string const planCoordinatorsPrefix = "/Plan/Coordinators";
|
|||
|
||||
std::vector<check_t> Supervision::checkDBServers() {
|
||||
std::vector<check_t> ret;
|
||||
Node::Children const& machinesPlanned =
|
||||
Node::Children const machinesPlanned =
|
||||
_snapshot(planDBServersPrefix).children();
|
||||
|
||||
for (auto const& machine : machinesPlanned) {
|
||||
|
@ -138,7 +138,7 @@ std::vector<check_t> Supervision::checkDBServers() {
|
|||
|
||||
std::vector<check_t> Supervision::checkCoordinators() {
|
||||
std::vector<check_t> ret;
|
||||
Node::Children const& machinesPlanned =
|
||||
Node::Children const machinesPlanned =
|
||||
_snapshot(planCoordinatorsPrefix).children();
|
||||
|
||||
for (auto const& machine : machinesPlanned) {
|
||||
|
@ -267,41 +267,37 @@ void Supervision::run() {
|
|||
|
||||
void Supervision::workJobs() {
|
||||
|
||||
Node::Children const& todos = _snapshot(toDoPrefix).children();
|
||||
Node::Children const& pends = _snapshot(pendingPrefix).children();
|
||||
Node::Children const todos = _snapshot(toDoPrefix).children();
|
||||
Node::Children const pends = _snapshot(pendingPrefix).children();
|
||||
|
||||
if (!todos.empty()) {
|
||||
for (auto const& todoEnt : todos) {
|
||||
Node const& job = *todoEnt.second;
|
||||
|
||||
try {
|
||||
std::string jobType = job("type").getString(),
|
||||
jobId = job("jobId").getString(),
|
||||
creator = job("creator").getString();
|
||||
if (jobType == "failedServer") {
|
||||
FailedServer fs(_snapshot, _agent, jobId, creator, _agencyPrefix);
|
||||
} else if (jobType == "cleanOutServer") {
|
||||
CleanOutServer cos(_snapshot, _agent, jobId, creator, _agencyPrefix);
|
||||
}
|
||||
} catch (std::exception const&) {}
|
||||
}
|
||||
for (auto const& todoEnt : todos) {
|
||||
Node const& job = *todoEnt.second;
|
||||
|
||||
try {
|
||||
std::string jobType = job("type").getString(),
|
||||
jobId = job("jobId").getString(),
|
||||
creator = job("creator").getString();
|
||||
if (jobType == "failedServer") {
|
||||
FailedServer fs(_snapshot, _agent, jobId, creator, _agencyPrefix);
|
||||
} else if (jobType == "cleanOutServer") {
|
||||
CleanOutServer cos(_snapshot, _agent, jobId, creator, _agencyPrefix);
|
||||
}
|
||||
} catch (std::exception const&) {}
|
||||
}
|
||||
|
||||
if (!pends.empty()) {
|
||||
for (auto const& pendEnt : pends) {
|
||||
Node const& job = *pendEnt.second;
|
||||
|
||||
try {
|
||||
std::string jobType = job("type").getString(),
|
||||
jobId = job("jobId").getString(),
|
||||
creator = job("creator").getString();
|
||||
if (jobType == "failedServer") {
|
||||
FailedServer fs(_snapshot, _agent, jobId, creator, _agencyPrefix);
|
||||
} else if (jobType == "cleanOutServer") {
|
||||
CleanOutServer cos(_snapshot, _agent, jobId, creator, _agencyPrefix);
|
||||
}
|
||||
} catch (std::exception const&) {}
|
||||
}
|
||||
for (auto const& pendEnt : pends) {
|
||||
Node const& job = *pendEnt.second;
|
||||
|
||||
try {
|
||||
std::string jobType = job("type").getString(),
|
||||
jobId = job("jobId").getString(),
|
||||
creator = job("creator").getString();
|
||||
if (jobType == "failedServer") {
|
||||
FailedServer fs(_snapshot, _agent, jobId, creator, _agencyPrefix);
|
||||
} else if (jobType == "cleanOutServer") {
|
||||
CleanOutServer cos(_snapshot, _agent, jobId, creator, _agencyPrefix);
|
||||
}
|
||||
} catch (std::exception const&) {}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -349,7 +345,7 @@ void Supervision::getUniqueIds() {
|
|||
try {
|
||||
latestId = std::stoul(
|
||||
_agent->readDB().get(_agencyPrefix + "/Sync/LatestID").slice().toJson());
|
||||
} catch (std::exception const&) {
|
||||
} catch (...) {
|
||||
std::this_thread::sleep_for (std::chrono::seconds(1));
|
||||
continue;
|
||||
}
|
||||
|
@ -375,7 +371,7 @@ void Supervision::getUniqueIds() {
|
|||
}
|
||||
|
||||
void Supervision::updateFromAgency() {
|
||||
auto const& jobsPending =
|
||||
auto const jobsPending =
|
||||
_snapshot("/Supervision/Jobs/Pending").children();
|
||||
|
||||
for (auto const& jobent : jobsPending) {
|
||||
|
|
|
@ -46,6 +46,11 @@ function ahuacatlNumericFunctionsTestSuite () {
|
|||
if (typeof(b) === 'number') {
|
||||
b = b.toPrecision(8);
|
||||
}
|
||||
if (((a === 0) && (b === 0.0))||
|
||||
((b === 0) && (a === 0.0))) {
|
||||
return;
|
||||
}
|
||||
|
||||
assertEqual(a, b);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue