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