-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change: RaftState: make vote private. Accesses vote via 2 new public …
…methods: `vote_ref()` and `vote_last_modified()`. There are several timer-related states that support heartbeat, election, and other functionalities. These states must be updated correctly in several places when the raft state changes. For example, when the vote or the membership changes. However, achieving consistency in all updates becomes difficult. To address this issue, this patch reduces the number of states that need to be maintained. Only the last-updated time is recorded every time the `vote` changes. Other states, such as leader lease and election timeout, are calculated only when needed. - Refactor: remove `VoteWiseTime`, remove `Command::InstallElectionTimer`. - Refactor: remove `next_election_time` from `RaftCore` - Refactor: update the last-modified time every time `vote` changes. Calculate leader lease and election timeout only when used. This way it reduces the number of state to maintain. - Refactor: Engine: move now from RaftState `timer` to track time, - Refactor: add UTime to track last-updated time for an object.
- Loading branch information
1 parent
ae28352
commit 9ddb571
Showing
31 changed files
with
588 additions
and
361 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
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
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
Oops, something went wrong.