Skip to content
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

Merged
merged 6 commits into from
Nov 8, 2019

Conversation

lzmhhh123
Copy link
Contributor

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

  • Unit test
  • Integration test

Side effects

  • Increased code complexity

Copy link
Member

@zz-jason zz-jason left a 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?

@lzmhhh123
Copy link
Contributor Author

@zz-jason Tests already changed.

@codecov
Copy link

codecov bot commented Nov 8, 2019

Codecov Report

Merging #13292 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #13292   +/-   ##
===========================================
  Coverage   80.5877%   80.5877%           
===========================================
  Files           469        469           
  Lines        113918     113918           
===========================================
  Hits          91804      91804           
  Misses        15176      15176           
  Partials       6938       6938

@@ -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 {
Copy link
Contributor

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.

Copy link
Contributor

@alivxxx alivxxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zz-jason zz-jason added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. labels Nov 8, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Nov 8, 2019

Your auto merge job has been accepted, waiting for 13251, 13252

@sre-bot
Copy link
Contributor

sre-bot commented Nov 8, 2019

/run-all-tests

@sre-bot sre-bot merged commit f3c8abb into pingcap:master Nov 8, 2019
XiaTianliang pushed a commit to XiaTianliang/tidb that referenced this pull request Dec 21, 2019
@lzmhhh123 lzmhhh123 deleted the bug-fix/isolation-and-hint branch December 24, 2019 09:29
lzmhhh123 added a commit to lzmhhh123/tidb that referenced this pull request Jan 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/coprocessor status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants