{"action":"created","issue":{"url":"https://api.github.com/repos/pingcap/tidb/issues/8081","repository_url":"https://api.github.com/repos/pingcap/tidb","labels_url":"https://api.github.com/repos/pingcap/tidb/issues/8081/labels{/name}","comments_url":"https://api.github.com/repos/pingcap/tidb/issues/8081/comments","events_url":"https://api.github.com/repos/pingcap/tidb/issues/8081/events","html_url":"https://github.com/pingcap/tidb/pull/8081","id":374753317,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2MzY2NTg0","number":8081,"title":"[DNM] store/tikv: Add end_key limit to kv_scan interface","user":{"login":"MyonKeminta","id":9948422,"node_id":"MDQ6VXNlcjk5NDg0MjI=","avatar_url":"https://avatars1.githubusercontent.com/u/9948422?v=4","gravatar_id":"","url":"https://api.github.com/users/MyonKeminta","html_url":"https://github.com/MyonKeminta","followers_url":"https://api.github.com/users/MyonKeminta/followers","following_url":"https://api.github.com/users/MyonKeminta/following{/other_user}","gists_url":"https://api.github.com/users/MyonKeminta/gists{/gist_id}","starred_url":"https://api.github.com/users/MyonKeminta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MyonKeminta/subscriptions","organizations_url":"https://api.github.com/users/MyonKeminta/orgs","repos_url":"https://api.github.com/users/MyonKeminta/repos","events_url":"https://api.github.com/users/MyonKeminta/events{/privacy}","received_events_url":"https://api.github.com/users/MyonKeminta/received_events","type":"User","site_admin":false},"labels":[{"id":972099262,"node_id":"MDU6TGFiZWw5NzIwOTkyNjI=","url":"https://api.github.com/repos/pingcap/tidb/labels/component/tikv-client","name":"component/tikv-client","color":"8bef73","default":false},{"id":510806005,"node_id":"MDU6TGFiZWw1MTA4MDYwMDU=","url":"https://api.github.com/repos/pingcap/tidb/labels/status/DNM","name":"status/DNM","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-10-28T13:21:20Z","updated_at":"2018-11-08T08:35:32Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/8081","html_url":"https://github.com/pingcap/tidb/pull/8081","diff_url":"https://github.com/pingcap/tidb/pull/8081.diff","patch_url":"https://github.com/pingcap/tidb/pull/8081.patch"},"body":"<!--\r\nThank you for contributing to TiDB! Please read TiDB's [CONTRIBUTING](https://github.com/pingcap/tidb/blob/master/CONTRIBUTING.md) document **BEFORE** filing this PR.\r\n-->\r\n\r\n### What problem does this PR solve? <!--add issue link with summary if exists-->\r\n\r\nWhen TiDB invokes kv_scan interface of TiKV, it provides an start_key and a limit (which means at most how many keys are retrieved in one RPC call). However, it may scan to a range that is already deleted.\r\nThe data in there ranges is undefined, which may cause some trouble. This PR tries to add an end_key limit to it.\r\n\r\n\r\n\r\n### What is changed and how it works?\r\n\r\nThis PR added end_key limit to the kv scan interface, and added the upper_bound parameter to the scanner of tikv client.\r\n\r\nMeanwhile, the Seek method of Retriever interface returns an Iterator. The end_key limit is perfectly suitable to be passed when an Iterator is creating, however it weird that the end_key parameter occurs in an function named `Seek`. Since it returns an Iterator, I think it's better to be renamed to `Iter` ratherthan `Seek`. In fact, the changes are just similar to https://github.com/pingcap/tidb/pull/7581 .\r\n\r\nThis PR depends on https://github.com/pingcap/kvproto/pull/306 , https://github.com/tikv/tikv/pull/3720 and #8178 . Also, this PR will be separated into multiple after merging the PR of kvproto.\r\n\r\n### Check List <!--REMOVE the items that are not applicable-->\r\n\r\n - Unit test (TODO)\r\n\r\nCode changes\r\n\r\n - Has interface methods change\r\n  - `Seek` and `SeekReverse` of `Retriever` are renamed to `Iter` and `IterReverse`\r\n\r\nSide effects\r\n\r\nNone\r\n\r\nRelated changes\r\n\r\n - Need to be included in the release note (maybe)\r\n"},"comment":{"url":"https://api.github.com/repos/pingcap/tidb/issues/comments/436914291","html_url":"https://github.com/pingcap/tidb/pull/8081#issuecomment-436914291","issue_url":"https://api.github.com/repos/pingcap/tidb/issues/8081","id":436914291,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjkxNDI5MQ==","user":{"login":"MyonKeminta","id":9948422,"node_id":"MDQ6VXNlcjk5NDg0MjI=","avatar_url":"https://avatars1.githubusercontent.com/u/9948422?v=4","gravatar_id":"","url":"https://api.github.com/users/MyonKeminta","html_url":"https://github.com/MyonKeminta","followers_url":"https://api.github.com/users/MyonKeminta/followers","following_url":"https://api.github.com/users/MyonKeminta/following{/other_user}","gists_url":"https://api.github.com/users/MyonKeminta/gists{/gist_id}","starred_url":"https://api.github.com/users/MyonKeminta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MyonKeminta/subscriptions","organizations_url":"https://api.github.com/users/MyonKeminta/orgs","repos_url":"https://api.github.com/users/MyonKeminta/repos","events_url":"https://api.github.com/users/MyonKeminta/events{/privacy}","received_events_url":"https://api.github.com/users/MyonKeminta/received_events","type":"User","site_admin":false},"created_at":"2018-11-08T08:35:32Z","updated_at":"2018-11-08T08:35:32Z","author_association":"MEMBER","body":"/run-all-tests"}}
{"actor":{"display_login":"MyonKeminta"}}