-
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
raftstore: introduce a precheck process before snapshot generation #17019
base: master
Are you sure you want to change the base?
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
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. |
Hi @hbisheng. Thanks for your PR. I'm waiting for a tikv member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
c977c70
to
89fa491
Compare
This commit implements a snapshot precheck process that leverages the snapshot concurrency limiter introduced in tikv#17015. The leader only proceeds to generate the snapshot after it receives a precheck succeed message from the follower. The precheck request and response are sent via the raft `ExtraMessage` where two new message types are added in kvproto. TODO: 1. Handle the case where the follower is on an old version without the snapshot precheck API. 2. Throttle the snapshot precheck requests, if necessary. Signed-off-by: Bisheng Huang <hbisheng@gmail.com>
89fa491
to
5001cad
Compare
Signed-off-by: Bisheng Huang <hbisheng@gmail.com>
I just realized a problem with the current concurrency limiter. If a single region leader keeps sending precheck requests to the same receiver (this may happen if the precheck response is somehow lost on the network), it would consume all reservations, thereby blocking other snapshots. I believe the concurrency limiter needs to be updated to deduplicate requests based on Created #17051 for this. |
Signed-off-by: Bisheng Huang <hbisheng@gmail.com>
…ant for precheck interval Signed-off-by: Bisheng Huang <hbisheng@gmail.com>
/cc @overvenus for review |
@hbisheng: GitHub didn't allow me to request PR reviews from the following users: for, review. Note that only tikv members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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. |
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.
Rest LGTM
// Wait for the first snapshot to be received and paused. | ||
let (tx, rx) = mpsc::channel(); | ||
let tx = Mutex::new(tx); | ||
fail::cfg_callback("receiving_snapshot_callback", move || { |
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.
We can reuse receiving_snapshot_net_error
as they are in the same position.
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.
I'm actually using both failpoints. What I want to achieve is to trigger a callback AND pause the thread. I don't know if there's a way to do that with a single failpoint.
fail_point!("receiving_snapshot_callback");
fail_point!("receiving_snapshot_net_error");
Co-authored-by: Neil Shen <overvenus@gmail.com> Signed-off-by: Bisheng Huang <hbisheng@gmail.com>
Signed-off-by: Bisheng Huang <hbisheng@gmail.com>
Signed-off-by: Bisheng Huang <hbisheng@gmail.com>
Signed-off-by: Bisheng Huang <hbisheng@gmail.com>
…ck requests Signed-off-by: Bisheng Huang <hbisheng@gmail.com>
The PR is ready for another review @overvenus @Connor1996 |
… limiter Signed-off-by: Bisheng Huang <hbisheng@gmail.com>
Signed-off-by: Bisheng Huang <hbisheng@gmail.com>
Signed-off-by: Bisheng Huang <hbisheng@gmail.com>
/check-dco |
Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits. 📝 Please follow instructions in the contributing guide to update your commits with the DCO Full details of the Developer Certificate of Origin can be found at developercertificate.org. The list of commits missing DCO signoff:
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. I understand the commands that are listed here. |
Signed-off-by: Bisheng Huang <hbisheng@gmail.com>
/ok-to-test |
@hbisheng: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
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.
LGTM
What is changed and how it works?
Issue Number: Close #15972
What's Changed:
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note