-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
tikvclient: Add endKey param to Scanner #8178
tikvclient: Add endKey param to Scanner #8178
Conversation
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
/run-integration-tests tikv=pr/3720 |
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
/run-integration-tests |
LGTM. PTAL @zhangjinpeng1987 |
Emmmm why is circleci canceled.. |
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
@tiancaiamao PTAL.. |
@@ -199,7 +202,7 @@ func (s *Scanner) getData(bo *Backoffer) error { | |||
// No more data in current Region. Next getData() starts | |||
// from current Region's endKey. | |||
s.nextStartKey = loc.EndKey | |||
if len(loc.EndKey) == 0 { | |||
if len(loc.EndKey) == 0 || (len(s.endKey) > 0 && kv.Key(s.nextStartKey).Cmp(kv.Key(s.endKey)) >= 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.
I find s.endKey == nil
and s.endKey == []byte{}
is not distinguished
Should we make it clear? or it's deliberately?
s.endKey == nil -- nobody set it
s.endKey == []byte{} -- it's actually set to a wrong value
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.
I tries to regards nil and empty the same, so I simply use len to judge whether it's set.
/run-all-tests |
/rebuild |
@tiancaiamao Can you help me re-run the circleci? |
LGTM |
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
What problem does this PR solve?
This PR is extracted from #8081 .
What is changed and how it works?
This PR updated kvproto to the newest so there is the EndKey param in kv scan RPC call. Then endKey was added to Scanner as an extra param of func
newScanner
.Also, an upperBound parameter was added to the
Seek
method ofRetriever
interface, and the method was renamed toIter
.This PR should be merged after tikv/tikv#3720 .(Done)Check List
Tests
Code changes
Side effects
None
Related changes
None