-
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
coprocessor: fix wrong cop task range for tiflash. #13292
Conversation
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 you add a test for this PR?
@zz-jason Tests already changed. |
Codecov Report
@@ Coverage Diff @@
## master #13292 +/- ##
===========================================
Coverage 80.5877% 80.5877%
===========================================
Files 469 469
Lines 113918 113918
===========================================
Hits 91804 91804
Misses 15176 15176
Partials 6938 6938 |
store/tikv/coprocessor.go
Outdated
@@ -239,7 +249,14 @@ func buildCopTasks(bo *Backoffer, cache *RegionCache, ranges *copRanges, req *kv | |||
i = nextI | |||
} | |||
} else if req.StoreType == kv.TiFlash { | |||
fullRange := kv.KeyRange{StartKey: regionWithRangeInfo.StartKey, EndKey: regionWithRangeInfo.EndKey} | |||
left, right := regionWithRangeInfo.StartKey, regionWithRangeInfo.EndKey | |||
if bytes.Compare(tableStart, left) >= 0 || len(left) == 0 { |
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.
No need to check len(left)
because if it is the case, previous check must be true.
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
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
Your auto merge job has been accepted, waiting for 13251, 13252 |
/run-all-tests |
What problem does this PR solve?
As the title says.
What is changed and how it works?
The full range of a region task is false to set at region full range. But when tidb coprocessor retries requests. It needs to be the table full range in a region. So change the region full range to the table full range in region can fix it.
Check List
Tests
Side effects