forked from datafuselabs/openraft
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: Remove repliation algorithm from ReplicationCore
Let Engine totally decide what to do, ReplicationCore becomes a passive executor. Engine emit a replication request and let ReplicationCore execute it. But it is not an exact one request one reply model, e.g., Engine does not expect the reply for a broadcast-committed request. Engine keeps the track of every inflight replication request, and update the `inflight` state when a reply is received from ReplicationCore. A new type `Inflight` is introduced to manage the state of inflight replication data, e.g., a series of log entries or a snapshot. ReplicationCore does not need to ask for RaftCore for snapshot anymore. But instead, if snapshot replication is needed, Engine will just send a snapshot to ReplicationCore. Introduce `ReplicationHandler` and `LogHandler` as a sub set function container of Engine, in order to make `Engine` not that big. Add more `Validate` implementations, to assert internal consistency. Add ProgressEntry::next_send() to calculate what entries/snapshot to send Remove ProgressEntry.mid; It can be calculated when needed. - Fix: datafuselabs#650
- Loading branch information
1 parent
c3763de
commit fa5f31c
Showing
28 changed files
with
1,379 additions
and
699 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
Oops, something went wrong.