-
Notifications
You must be signed in to change notification settings - Fork 113
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
[close #540] rawkv: fix scan return empty set while exist empty key #541
Conversation
Signed-off-by: iosmanthus <[email protected]>
Signed-off-by: iosmanthus <[email protected]>
src/main/java/org/tikv/common/operation/iterator/RawScanIterator.java
Outdated
Show resolved
Hide resolved
test failed, please take a look:
|
Signed-off-by: iosmanthus <[email protected]>
Fixed, PTAL |
Signed-off-by: iosmanthus <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #541 +/- ##
============================================
+ Coverage 31.72% 31.87% +0.14%
- Complexity 1303 1320 +17
============================================
Files 278 278
Lines 17344 17345 +1
Branches 1975 1975
============================================
+ Hits 5503 5528 +25
+ Misses 11223 11215 -8
+ Partials 618 602 -16
Continue to review full report at Codecov.
|
if (!processingLastBatch) { | ||
return false; | ||
} |
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.
if limit > 0 && processingLastBatch = false
:
- your code returns
false
- origional code returns
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.
In hasNext
, it call !endOfScan()
instead of notEndOfScan
which is more confusing.
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.
ok, I understand.
I recommend to separate bug fix
and code refactor
in 2 PRs.
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.
others, LGTM
@@ -360,6 +378,16 @@ public void simpleTest() { | |||
return client.scan(RAW_START_KEY, RAW_END_KEY); | |||
} | |||
|
|||
// https://github.com/tikv/client-java/issues/540 |
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.
we can find the issue link according to the commit id.
src/main/java/org/tikv/common/operation/iterator/RawScanIterator.java
Outdated
Show resolved
Hide resolved
Signed-off-by: iosmanthus <[email protected]>
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
/merge |
/run-all-tests |
@iosmanthus test failed:
|
It should be an upstream issue.
|
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-3.1 in PR #545 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-3.2 in PR #546 |
Signed-off-by: ti-srebot <[email protected]> Co-authored-by: iosmanthus <[email protected]>
This reverts commit ad6a00f.
This reverts commit ad6a00f.
…541) (#548) * rawkv: cherry-pick fix-scan-empty-key Signed-off-by: iosmanthus <[email protected]> * rawkv: fix missing parameters Signed-off-by: iosmanthus <[email protected]>
Signed-off-by: ti-srebot <[email protected]> Co-authored-by: iosmanthus <[email protected]>
Signed-off-by: iosmanthus [email protected]
What problem does this PR solve?
Issue Number: close #540
Problem Description:
This pull request adds an empty key check for
RawScanIterator.hasNext
, otherwise, if there is an empty key in TiKV, the scan will always return an empty set.Check List for Tests
This PR has been tested by at least one of the following methods: