-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
store/tikv: Randomize selection of proxy store on network partition #23530
store/tikv: Randomize selection of proxy store on network partition #23530
Conversation
/LGTM |
/run-check_dev_2 |
[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 writing |
/run-check_dev_2 |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 2d58be5
|
/merge |
/run-check_dev_2 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.0 in PR #23560 |
What problem does this PR solve?
Problem Summary: Previously, when TiDB finds a request need to be forwarded, it simply iterates over all the peers sequentially until finding one. However, if there's only 3 TiKV nodes in the cluster and the regions are rarely scheduled, most of their peer lists may have the same order, causing the selected proxy peer very likely to be imbalanced. This PR tries to randomize the first choice of the proxy peer, and iterate over the list for further retires.
What is changed and how it works?
What's Changed: Randomize selection of proxy store in GetTiKVRPCContext and OnSendFail.
How it Works:
Related changes
Check List
Tests
Release note