Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
address @bright-starry-sky's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
critical27 committed Jun 10, 2021
1 parent 3d4fe5b commit bca0ce3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/kvstore/Listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ std::pair<int64_t, int64_t> Listener::commitSnapshot(const std::vector<std::stri
}
if (finished) {
CHECK(!raftLock_.try_lock());
leaderCommitId_ = committedLogId;
lastApplyLogId_ = committedLogId;
persist(committedLogId, committedLogTerm, lastApplyLogId_);
LOG(INFO) << idStr_ << "Listener succeeded apply log to " << lastApplyLogId_;
Expand Down
1 change: 1 addition & 0 deletions src/kvstore/Listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class Listener : public raftex::RaftPart {
}

void cleanup() override {
leaderCommitId_ = 0;
lastApplyLogId_ = 0;
persist(0, 0, lastApplyLogId_);
}
Expand Down

0 comments on commit bca0ce3

Please sign in to comment.