-
Notifications
You must be signed in to change notification settings - Fork 225
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
Make slow store filtering the highest priority in replica selector v2 #1267
Make slow store filtering the highest priority in replica selector v2 #1267
Conversation
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
/cc @crazycs520 PTAL |
s.True(s.runCaseAndCompare(ca)) | ||
|
||
s.T().Logf("test case: stale read: %v, with label: %v, slow: true", staleRead, withLabel) | ||
expectedFirstStore := 2 |
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 the expectedFirstStore
also be 3
if labels are not set and store 1 is slow with kv.ReplicaReadMixed
?
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 PR LGTM.
I'm wondering whether one single strategy can meet all user cases: what if some users are latency insensitive but very care about cross AZ traffic, or RTT is known to be unacceptable when cross AZ. Maybe we need to rethink the UI of replica selector (tidb_replica_read
) later, how to make it reasonable and user-friendly.
…mote-priority-of-slow-score-filtering
@crazycs520 @cfzjywxk @zyguan I'm considering removing FYI the failure message of that test case (code here)
|
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Make slow store filtering the highest priority in replica selector v2.
With some minor changes:
storeSelectionScore
andString
method which might help in loggingThere are some behavior inconsistencies found between v1 and v2 and maybe we need some discussion. I want to finish this PR within April 8 if possible so that this can be included in release-8.1 branch.
The inconsistencies are all about replica read mode without stale read and labels are specified, in which cases this branch in
calculateScore
is executed:https://github.com/MyonKeminta/client-go/blob/05eec3f6f7a5e49b7aff92862716253afa882da5/internal/locate/replica_selector.go#L367-L370
And what it causes are: