Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move replication algorithm to Engine #650

Closed
Tracked by #291
drmingdrmer opened this issue Jan 22, 2023 · 1 comment · Fixed by #651
Closed
Tracked by #291

Move replication algorithm to Engine #650

drmingdrmer opened this issue Jan 22, 2023 · 1 comment · Fixed by #651

Comments

@drmingdrmer
Copy link
Member

No description provided.

@github-actions
Copy link

👋 Thanks for opening this issue!

Get help or engage by:

  • /help : to print help messages.
  • /assignme : to assign this issue to you.

@drmingdrmer drmingdrmer changed the title ... Move replication algorithm to Engine Jan 22, 2023
drmingdrmer added a commit to drmingdrmer/openraft that referenced this issue Jan 22, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant