Simplify log compaction
Summary: Teon found this nit so we might fix it. Reviewers: ipaljak Reviewed By: ipaljak Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1860
This commit is contained in:
parent
cbd6f3bbe2
commit
68c910a083
@ -982,6 +982,10 @@ void RaftServer::SnapshotThread() {
|
|||||||
VLOG(40) << "[LogCompaction] Creating snapshot.";
|
VLOG(40) << "[LogCompaction] Creating snapshot.";
|
||||||
bool status = durability::MakeSnapshot(*db_, *dba, durability_dir_,
|
bool status = durability::MakeSnapshot(*db_, *dba, durability_dir_,
|
||||||
snapshot_filename);
|
snapshot_filename);
|
||||||
|
|
||||||
|
// Raft lock must be released when destroying dba object.
|
||||||
|
dba = nullptr;
|
||||||
|
|
||||||
lock.lock();
|
lock.lock();
|
||||||
|
|
||||||
if (status) {
|
if (status) {
|
||||||
@ -1004,11 +1008,7 @@ void RaftServer::SnapshotThread() {
|
|||||||
disk_storage_.Delete(LogEntryKey(i));
|
disk_storage_.Delete(LogEntryKey(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
lock.unlock();
|
|
||||||
// Raft lock must be released when destroying dba object.
|
|
||||||
dba = nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::this_thread::sleep_for(kSnapshotPeriod);
|
std::this_thread::sleep_for(kSnapshotPeriod);
|
||||||
|
Loading…
Reference in New Issue
Block a user