-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
raft: replace logSynced bool with leaderTerm
Tracking the term of the leader with whom the log is consistent is more straightforward than tracking an obscure bool. It also comens with extra benefits when the TODO to add more safety checks to raftLog is done: leaderTerm can be compared for establishing the order, whereas the bool can only be true/false. Initializing leaderTerm during the raftLog initialization is cheaper compared to initializing it in becomeFollower(), because the former happens only once, while the former can happen many times during the lifetime of this node. Signed-off-by: Pavel Kalinnikov <[email protected]>
- Loading branch information
Showing
2 changed files
with
42 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters