-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve: move state machine operations to another task
State machine operations, such as applying log entries, building/installing/getting snapshot are moved to `core::sm::Worker`, which is run in a standalone task other than the one running `RaftCore`. In this way, log io operation(mostly appending log entries) and state machine io operations(mostly applying log entries) can be paralleled. - Log io are sitll running in `RaftCore` task. - Snapshot receiving/streaming are removed from `RaftCore`. - Add `IOState` to `RaftState` to track the applied log id. This field is used to determine whether a certain command, such as sending a response, can be executed after a specific log has been applied. - Refactor: `leader_step_down()` can only be run when the response of the second change-membership is sent. Before this commit, updating the `committed` is done atomically with sending back response. Since thie commit, these two steps are done separately, because applying log entries are moved to another task. Therefore `leader_step_down()` must wait for these two steps to be finished.
- Loading branch information
1 parent
e5935a3
commit 6769cdd
Showing
33 changed files
with
960 additions
and
270 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 was deleted.
Oops, something went wrong.
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.