1
0
Fork 0

Merge branch 'devel' of ssh://github.com/ArangoDB/ArangoDB into devel

This commit is contained in:
Max Neunhoeffer 2016-05-31 13:50:10 -06:00
commit 9062ff2457
2 changed files with 14 additions and 3 deletions

View File

@ -424,7 +424,11 @@ Agent& Agent::operator=(VPackSlice const& compaction) {
MUTEX_LOCKER(mutexLocker, _ioLock);
_spearhead = compaction.get("readDB");
_readDB = compaction.get("readDB");
_lastCommitIndex = std::stoul(compaction.get("_key").copyString());
try {
_lastCommitIndex = std::stoul(compaction.get("_key").copyString());
} catch (std::exception const& e) {
LOG_TOPIC(ERR, Logger::AGENCY) << e.what();
}
_nextCompationAfter = _lastCommitIndex + _config.compactionStepSize;
return *this;
}

View File

@ -294,7 +294,11 @@ bool State::loadCompacted() {
for (auto const& i : VPackArrayIterator(result)) {
buffer_t tmp = std::make_shared<arangodb::velocypack::Buffer<uint8_t>>();
(*_agent) = i;
_cur = std::stoul(i.get("_key").copyString());
try {
_cur = std::stoul(i.get("_key").copyString());
} catch (std::exception const& e) {
LOG_TOPIC(ERR, Logger::AGENCY) << e.what();
}
}
}
@ -331,7 +335,10 @@ bool State::loadRemaining() {
static_cast<term_t>(i.get("term").getUInt()),
static_cast<arangodb::consensus::id_t>(i.get("leader").getUInt()),
tmp));
} catch (...) {
} catch (std::exception const& e) {
LOG_TOPIC(ERR, Logger::AGENCY) <<
"Failed to convert " + i.get(StaticStrings::KeyString).copyString() +
" to integer via std::stoi." << e.what();
}
}
}