-
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
domain: disable closest-adaptive dynamically to make read traffic more even #38960
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. |
@nolouch PTAL |
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
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 3bc3d83
|
TiDB MergeCI notify🔴 Bad News! New failing [1] after this pr merged.
|
What problem does this PR solve?
Issue Number: ref #35926
Problem Summary:
What is changed and how it works?
This PR is an enhancement of #36824, in the previous PR, we only enable "closest-adaptive" when all AZ's contains both tidb and tikv instance. But the previous change can't guarantee that traffic is evenly distribute in different when the tidb instances number is different across AZs.
This PR improve the strategy by always enable the same number of tidb instances' "closest-adaptive" in all AZs and set the extra instances with "leader" read.
Since tidb is stateless, we use a simple algorithm to choose the extra tidb instance by choosing tidb with a bigger ID first.
Example:
There are 3 tikv instance in 3 AZ az1, az2, az3. And 5 tidb server: tidb1 in az1, tidb2 and tidb3 in az2, tidb4 in az3, tidb5 in az4.
In the previous version we will just disable "closest-adaptive" on all tidb because az4 contains no tikv.
After this change, only tidb5 and tidb3 is disabled, and the other 3 are enabled.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.