-
Notifications
You must be signed in to change notification settings - Fork 725
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
mcs: fix the scatter error #7241
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. |
894a41b
to
87c4368
Compare
Codecov Report
@@ Coverage Diff @@
## master #7241 +/- ##
==========================================
+ Coverage 74.35% 74.37% +0.01%
==========================================
Files 446 446
Lines 48159 48198 +39
==========================================
+ Hits 35810 35846 +36
+ Misses 9191 9189 -2
- Partials 3158 3163 +5
Flags with carried forward coverage won't be shown. Click here to find out more. |
/check-issue-triage-complete |
Signed-off-by: Ryan Leung <rleungx@gmail.com>
87c4368
to
e19265f
Compare
Signed-off-by: Ryan Leung <rleungx@gmail.com>
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 rest LGTM
if len(regionsID) == 1 { | ||
return 0, nil, errors.New("region not found") | ||
} |
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.
how about moving it to L188
if len(regionsID) == 1 {
if r.cluster.GetRegion(regionsID[0])==nil{
scatterSkipNoRegionCounter.Inc()
return 0, nil, errors.New("region not found")
}
}
var regionsID []uint64 | ||
// nolint | ||
if request.GetRegionId() != 0 { | ||
// nolint | ||
regionsID = []uint64{request.GetRegionId()} | ||
} else { | ||
regionsID = request.GetRegionsId() | ||
} |
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.
why need nolint?
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.
GetRegionId is deprecated
@@ -2134,6 +2152,15 @@ func (s *GrpcServer) invalidValue(msg string) *pdpb.ResponseHeader { | |||
func (s *GrpcServer) convertHeader(header *schedulingpb.ResponseHeader) *pdpb.ResponseHeader { | |||
switch header.GetError().GetType() { | |||
case schedulingpb.ErrorType_UNKNOWN: | |||
if strings.Contains(header.GetError().GetMessage(), "region not found") { |
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.
how about using const value for "region not found"
Signed-off-by: Ryan Leung <rleungx@gmail.com>
return 0, nil, errors.New("empty region") | ||
return 0, nil, errEmptyRegion | ||
} | ||
if len(regionsID) == 1 { |
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.
It's different from previous, do we need to check whether it is nil?
Signed-off-by: Ryan Leung <rleungx@gmail.com>
/merge |
@lhy1024: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
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 ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 7e28af7
|
close tikv#7234 Signed-off-by: Ryan Leung <rleungx@gmail.com> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
What problem does this PR solve?
Issue Number: Close #7234.
What is changed and how does it work?
Check List
Tests
https://tcms.pingcap.net/dashboard/executions/plan/3450271
Release note