-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 store: follower replication for write-flow #13533
base: master
Are you sure you want to change the base?
Conversation
[REVIEW NOTIFICATION] This pull request has not been approved. To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
The changes on the raft-rs side is here tikv/raft-rs#485. |
17fd9a5
to
567ba83
Compare
Signed-off-by: LintianShi <lintian.shi@pingcap.com>
Signed-off-by: LintianShi <lintian.shi@pingcap.com>
80968da
to
4781751
Compare
} | ||
} | ||
} else { | ||
for msg in msgs { |
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.
minor: maybe it's better to put else to if as it's the more common code path. Just for better readability.
if let Some(to_peer_zone) = ctx.zone_info.get(&to_peer_store_id) && to_peer_zone != leader_zone | ||
{ | ||
// If batch_append is disabled, there may be several MsgAppend to a same peer in msgs. | ||
// The agent should not forward more than one MsgAppend to a single peer. |
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.
// The agent should not forward more than one MsgAppend to a single peer.
Could you elaborate the reason?
raft_msgs.push(m); | ||
let leader_store_id = self.peer.get_store_id(); | ||
|
||
if self.raft_group.raft.follower_replication() && self.is_leader() && let Some(leader_zone) = ctx.zone_info.get(&leader_store_id) { |
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.
Could you summarize the algorithm of the following code block?
4781751
to
8390c9a
Compare
Signed-off-by: LintianShi <lintian.shi@pingcap.com>
Signed-off-by: LintianShi <lintian.shi@pingcap.com>
Signed-off-by: LintianShi <lintian.shi@pingcap.com>
Signed-off-by: LintianShi <lintian.shi@pingcap.com>
Signed-off-by: LintianShi <lintian.shi@pingcap.com>
8390c9a
to
0ee94f6
Compare
@LintianShi: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: LintianShi <lintian.shi@pingcap.com>
What is changed and how it works?
Issue Number: Close #13269
What's Changed:
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note