mirror of https://gitee.com/bigwinds/arangodb
go on in case of errors
This commit is contained in:
parent
4ea26cd10f
commit
e79f9779b3
|
@ -52,28 +52,34 @@ void RocksDBBackgroundThread::run() {
|
|||
guard.wait(static_cast<uint64_t>(_interval * 1000000.0));
|
||||
}
|
||||
|
||||
if (!isStopping()) {
|
||||
_engine->counterManager()->sync(false);
|
||||
}
|
||||
try {
|
||||
if (!isStopping()) {
|
||||
_engine->counterManager()->sync(false);
|
||||
}
|
||||
|
||||
bool force = isStopping();
|
||||
_engine->replicationManager()->garbageCollect(force);
|
||||
bool force = isStopping();
|
||||
_engine->replicationManager()->garbageCollect(force);
|
||||
|
||||
TRI_voc_tick_t minTick = rocksutils::latestSequenceNumber();
|
||||
if (DatabaseFeature::DATABASE != nullptr) {
|
||||
DatabaseFeature::DATABASE->enumerateDatabases(
|
||||
[force, &minTick](TRI_vocbase_t* vocbase) {
|
||||
vocbase->cursorRepository()->garbageCollect(force);
|
||||
// FIXME: configurable interval tied to follower timeout
|
||||
vocbase->garbageCollectReplicationClients(60.0);
|
||||
auto clients = vocbase->getReplicationClients();
|
||||
for (auto c : clients) {
|
||||
if (std::get<2>(c) < minTick) {
|
||||
minTick = std::get<2>(c);
|
||||
TRI_voc_tick_t minTick = rocksutils::latestSequenceNumber();
|
||||
if (DatabaseFeature::DATABASE != nullptr) {
|
||||
DatabaseFeature::DATABASE->enumerateDatabases(
|
||||
[force, &minTick](TRI_vocbase_t* vocbase) {
|
||||
vocbase->cursorRepository()->garbageCollect(force);
|
||||
// FIXME: configurable interval tied to follower timeout
|
||||
vocbase->garbageCollectReplicationClients(60.0);
|
||||
auto clients = vocbase->getReplicationClients();
|
||||
for (auto c : clients) {
|
||||
if (std::get<2>(c) < minTick) {
|
||||
minTick = std::get<2>(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
_engine->pruneWalFiles(minTick);
|
||||
});
|
||||
_engine->pruneWalFiles(minTick);
|
||||
}
|
||||
} catch (std::exception const& ex) {
|
||||
LOG_TOPIC(WARN, Logger::FIXME) << "caught exception in rocksdb background thread: " << ex.what();
|
||||
} catch (...) {
|
||||
LOG_TOPIC(WARN, Logger::FIXME) << "caught unknown exception in rocksdb background";
|
||||
}
|
||||
}
|
||||
_engine->counterManager()->sync(true); // final write on shutdown
|
||||
|
|
Loading…
Reference in New Issue