-
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
Implement reverse iterator #9564
Conversation
@arthurkiller Manual test is not enough. Could you add some unit tests? |
@shenli thx for reply and I will fix the unit test then. But I'm not sure if |
@arthurkiller Thanks for your contribution! If you need any help, please let us know. :) |
API did not add end key limitation yet. Should I add this?
Have an awesome day
✉️✉️✉️✉️✉️✉️✉️✉️✉️✉️✉️✉️
Arthur lee
Sent from my iPhone
… On 6 Mar 2019, at 10:08 AM, disksing ***@***.***> wrote:
@disksing commented on this pull request.
In store/tikv/scan.go:
> @@ -172,6 +176,11 @@ func (s *Scanner) getData(bo *Backoffer) error {
NotFillCache: s.snapshot.notFillCache,
},
}
+ // Reverse seek will not limit endKey.
Reverse scan stops at end_key too. See the description here: https://github.com/pingcap/kvproto/blob/ab7debc182d9c536775b3adde7e35716f10bc0b6/proto/kvrpcpb.proto#L106-L107
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@arthurkiller I think it's ok to update |
@arthurkiller Cool! |
seems SDK did not mock the reverse yet |
anyway I have added the test case in this pr @shenli have you got any plan to add this mock? |
Seems the tests are failing. @arthurkiller |
seems SDK did not mock the reverse yet @disksing |
@arthurkiller Could update the master branch and resolve conflicts? |
Hi contributor, thanks for your PR. This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically. |
please follow CONTRIBUTING.md to refine the PR title. |
@zz-jason okay, I will finish this later this week |
@crazycs520 Seems you have added the IterReverse already, is that right? |
@arthurkiller, Sorry for that, I don't know this pr before, I write PR #10152 to speed up |
nvm, so we can use CC @shafreeck |
@arthurkiller, Thanks for the contribution. |
What problem does this PR solve?
Request
IterReverse
for long.See also #7429
What is changed and how it works?
IIRC we asking for reverse iterator since last summer, and the job was block on the dependency last year (#7429).
Finally I implemented
reverseIterator
for tikv SDK by add a new member fortikv.Scanner
.getRegion
on reverse will return the key from start to end in descend ordernextStartKey
to theStartKey.Next()
, cause the region will not containsStartKey
.StartKey
is blank, we met the very first region stop the iterator.Check List
Tests
Side effects
rely on these functions already implemented
and changed this internal function
Related changes