-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
raft: support lazy replication #131588
raft: support lazy replication #131588
Conversation
13b9369
to
1bd9d89
Compare
1bd9d89
to
f0df3d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - appreciate the clean commits.
I'm mostly still unsure why it looks like we can send nonempty probes in lazy mode. Once that is resolved this PR is ready as far as I'm concerned.
This commits adds a prep test for the next commit, to demonstrate the difference between the eager and lazy replication. Epic: none Release note: none
Epic: none Release note: none
This commit adds support for LazyReplication mode in raft. In this mode, the leader does not send MsgApp messages eagerly to StateReplicate peers. Instead, the appends are requested explicitly by the application layer, via the RawNode.SendMsgApp() method. The application: - monitors the replication flow state to all followers, e.g. using the RawNode.Status() method, - for peers who have outstanding replication work, decides when and how much worth of the log to send out, - fetches the log slice from the RawNode.LogSnapshot(), - sends the appends using the RawNode.SendMsgApp() method. Epic: none Release note: none
Epic: none Release note: none
f0df3d7
to
476b4f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 7 files at r5, 2 of 2 files at r6, 2 of 2 files at r7, 4 of 5 files at r8, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @iskettaneh and @tbg)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the explainers!
bors r=tbg,sumeerbhola |
This PR adds support for
LazyReplication
mode in raft. In this mode, the leader does not sendMsgApp
messages eagerly toStateReplicate
peers. Instead, the appends are requested explicitly by the application layer, via theRawNode.SendMsgApp()
method.The application:
RawNode.Status()
method,RawNode.LogSnapshot()
,RawNode.SendMsgApp()
method.Part of #128779