Skip to content

Commit

Permalink
skip leader lease check in snapshot manager (vesoft-inc#793)
Browse files Browse the repository at this point in the history
Co-authored-by: Sophie <[email protected]>
  • Loading branch information
critical27 and Sophie-Xie authored Apr 12, 2022
1 parent 1bc88cc commit e897ad6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/kvstore/NebulaSnapshotManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ nebula::cpp2::ErrorCode NebulaSnapshotManager::prefixScan(Part* part,
const std::string& prefix,
std::unique_ptr<KVIterator>* iter,
const void* snapshot) {
if (!part->isLeader() || !part->leaseValid()) {
return nebula::cpp2::ErrorCode::E_LEADER_CHANGED;
}
// Use kv-engine directly to avoid acquire lock in kvstore, and we **DO NOT** check leader lease:
// 1. To avoid lots of snapshot impact leader stability
// 2. The snapshot of state machine could be applied to other nodes even if leader has changed
return part->engine()->prefix(prefix, iter, snapshot);
}

Expand Down

0 comments on commit e897ad6

Please sign in to comment.