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

store/tikv/range_task: Fix unnecessary loop; add tests for failures of RangeTaskRunner #10708

Conversation

MyonKeminta
Copy link
Contributor

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

What problem does this PR solve?

In range_task.go, The break statement breaks the select rather than the outer for. At first I thought it would be a severe bug, but then I realized that it doesn't affect the correctness. It just causes some unnecessary loops in failures. This PR fixed it.

By the way some tests are added to ensure when one of the subtasks returns error, the whole task returns error. I wrote it because I thought the incorrect break statement might cause any severe bug, but it actually not. But after all, this test is still useful, I think. So I kept it.

What is changed and how it works?

  • Added label to indicate the break statement breaks the outer for loop
  • Added a test for cases with error.

Check List

Tests

  • Unit test

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Jun 4, 2019

Codecov Report

Merging #10708 into master will increase coverage by 0.0194%.
The diff coverage is 100%.

@@               Coverage Diff                @@
##             master     #10708        +/-   ##
================================================
+ Coverage   79.8187%   79.8381%   +0.0194%     
================================================
  Files           415        415                
  Lines         88290      88251        -39     
================================================
- Hits          70472      70458        -14     
+ Misses        12605      12580        -25     
  Partials       5213       5213

@tiancaiamao
Copy link
Contributor

LGTM

@tiancaiamao
Copy link
Contributor

/run-all-tests

@tiancaiamao tiancaiamao added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 10, 2019
@tiancaiamao
Copy link
Contributor

PTAL @disksing

@tiancaiamao tiancaiamao merged commit b3a443b into pingcap:master Jun 10, 2019
@MyonKeminta MyonKeminta deleted the misono/fix-unnecessary-loop-in-rangetask branch June 11, 2019 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/tikv status/LGT1 Indicates that a PR has LGTM 1. type/bug-fix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants