{"action":"created","comment":{"url":"https://api.github.com/repos/pingcap/tikv/pulls/comments/166196550","pull_request_review_id":94235949,"id":166196550,"diff_hunk":"@@ -266,13 +284,107 @@ impl SnapContext {\n                 escape(&end_key),\n                 e\n             );\n+        } else {\n+            info!(\n+                \"succeed in deleting data in [{}, {})\",\n+                escape(&start_key),\n+                escape(&end_key),\n+            );\n+        }\n+    }\n+}\n+\n+#[derive(Default)]\n+struct PendingDeleteRanges {\n+    ranges: BTreeMap<Vec<u8>, (Vec<u8>, time::Instant)>,\n+}\n+\n+impl PendingDeleteRanges {\n+    // find out the ranges that need to be trimed or discarded\n+    fn find_overlap(\n+        &self,\n+        start_key: Vec<u8>,\n+        end_key: Vec<u8>,\n+        ranges: &mut Vec<(Vec<u8>, Vec<u8>)>,","path":"src/raftstore/store/worker/region.rs","position":122,"original_position":122,"commit_id":"bcff24db0110132eb3e9a9ee5564c8fa96607e33","original_commit_id":"bcff24db0110132eb3e9a9ee5564c8fa96607e33","user":{"login":"zhangjinpeng1987","id":19700528,"avatar_url":"https://avatars2.githubusercontent.com/u/19700528?v=4","gravatar_id":"","url":"https://api.github.com/users/zhangjinpeng1987","html_url":"https://github.com/zhangjinpeng1987","followers_url":"https://api.github.com/users/zhangjinpeng1987/followers","following_url":"https://api.github.com/users/zhangjinpeng1987/following{/other_user}","gists_url":"https://api.github.com/users/zhangjinpeng1987/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangjinpeng1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangjinpeng1987/subscriptions","organizations_url":"https://api.github.com/users/zhangjinpeng1987/orgs","repos_url":"https://api.github.com/users/zhangjinpeng1987/repos","events_url":"https://api.github.com/users/zhangjinpeng1987/events{/privacy}","received_events_url":"https://api.github.com/users/zhangjinpeng1987/received_events","type":"User","site_admin":false},"body":"Use ranges as return type.","created_at":"2018-02-06T06:27:40Z","updated_at":"2018-02-06T06:27:41Z","html_url":"https://github.com/pingcap/tikv/pull/2736#discussion_r166196550","pull_request_url":"https://api.github.com/repos/pingcap/tikv/pulls/2736","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/comments/166196550"},"html":{"href":"https://github.com/pingcap/tikv/pull/2736#discussion_r166196550"},"pull_request":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/2736"}}},"pull_request":{"url":"https://api.github.com/repos/pingcap/tikv/pulls/2736","id":166517797,"html_url":"https://github.com/pingcap/tikv/pull/2736","diff_url":"https://github.com/pingcap/tikv/pull/2736.diff","patch_url":"https://github.com/pingcap/tikv/pull/2736.patch","issue_url":"https://api.github.com/repos/pingcap/tikv/issues/2736","number":2736,"state":"open","locked":false,"title":"use DeleteFilesInRange to delete region","user":{"login":"UncP","id":16263931,"avatar_url":"https://avatars1.githubusercontent.com/u/16263931?v=4","gravatar_id":"","url":"https://api.github.com/users/UncP","html_url":"https://github.com/UncP","followers_url":"https://api.github.com/users/UncP/followers","following_url":"https://api.github.com/users/UncP/following{/other_user}","gists_url":"https://api.github.com/users/UncP/gists{/gist_id}","starred_url":"https://api.github.com/users/UncP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UncP/subscriptions","organizations_url":"https://api.github.com/users/UncP/orgs","repos_url":"https://api.github.com/users/UncP/repos","events_url":"https://api.github.com/users/UncP/events{/privacy}","received_events_url":"https://api.github.com/users/UncP/received_events","type":"User","site_admin":false},"body":"Before you review this pr, please take a look at the doc that I send to tikv@pingcap.com.","created_at":"2018-02-01T11:59:23Z","updated_at":"2018-02-06T06:27:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[{"login":"siddontang","id":1080370,"avatar_url":"https://avatars2.githubusercontent.com/u/1080370?v=4","gravatar_id":"","url":"https://api.github.com/users/siddontang","html_url":"https://github.com/siddontang","followers_url":"https://api.github.com/users/siddontang/followers","following_url":"https://api.github.com/users/siddontang/following{/other_user}","gists_url":"https://api.github.com/users/siddontang/gists{/gist_id}","starred_url":"https://api.github.com/users/siddontang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siddontang/subscriptions","organizations_url":"https://api.github.com/users/siddontang/orgs","repos_url":"https://api.github.com/users/siddontang/repos","events_url":"https://api.github.com/users/siddontang/events{/privacy}","received_events_url":"https://api.github.com/users/siddontang/received_events","type":"User","site_admin":false},{"login":"huachaohuang","id":7806468,"avatar_url":"https://avatars0.githubusercontent.com/u/7806468?v=4","gravatar_id":"","url":"https://api.github.com/users/huachaohuang","html_url":"https://github.com/huachaohuang","followers_url":"https://api.github.com/users/huachaohuang/followers","following_url":"https://api.github.com/users/huachaohuang/following{/other_user}","gists_url":"https://api.github.com/users/huachaohuang/gists{/gist_id}","starred_url":"https://api.github.com/users/huachaohuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huachaohuang/subscriptions","organizations_url":"https://api.github.com/users/huachaohuang/orgs","repos_url":"https://api.github.com/users/huachaohuang/repos","events_url":"https://api.github.com/users/huachaohuang/events{/privacy}","received_events_url":"https://api.github.com/users/huachaohuang/received_events","type":"User","site_admin":false}],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/pingcap/tikv/pulls/2736/commits","review_comments_url":"https://api.github.com/repos/pingcap/tikv/pulls/2736/comments","review_comment_url":"https://api.github.com/repos/pingcap/tikv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pingcap/tikv/issues/2736/comments","statuses_url":"https://api.github.com/repos/pingcap/tikv/statuses/bcff24db0110132eb3e9a9ee5564c8fa96607e33","head":{"label":"UncP:uncp/delete-files-in-range","ref":"uncp/delete-files-in-range","sha":"bcff24db0110132eb3e9a9ee5564c8fa96607e33","user":{"login":"UncP","id":16263931,"avatar_url":"https://avatars1.githubusercontent.com/u/16263931?v=4","gravatar_id":"","url":"https://api.github.com/users/UncP","html_url":"https://github.com/UncP","followers_url":"https://api.github.com/users/UncP/followers","following_url":"https://api.github.com/users/UncP/following{/other_user}","gists_url":"https://api.github.com/users/UncP/gists{/gist_id}","starred_url":"https://api.github.com/users/UncP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UncP/subscriptions","organizations_url":"https://api.github.com/users/UncP/orgs","repos_url":"https://api.github.com/users/UncP/repos","events_url":"https://api.github.com/users/UncP/events{/privacy}","received_events_url":"https://api.github.com/users/UncP/received_events","type":"User","site_admin":false},"repo":{"id":112136423,"name":"tikv","full_name":"UncP/tikv","owner":{"login":"UncP","id":16263931,"avatar_url":"https://avatars1.githubusercontent.com/u/16263931?v=4","gravatar_id":"","url":"https://api.github.com/users/UncP","html_url":"https://github.com/UncP","followers_url":"https://api.github.com/users/UncP/followers","following_url":"https://api.github.com/users/UncP/following{/other_user}","gists_url":"https://api.github.com/users/UncP/gists{/gist_id}","starred_url":"https://api.github.com/users/UncP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UncP/subscriptions","organizations_url":"https://api.github.com/users/UncP/orgs","repos_url":"https://api.github.com/users/UncP/repos","events_url":"https://api.github.com/users/UncP/events{/privacy}","received_events_url":"https://api.github.com/users/UncP/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/UncP/tikv","description":"Distributed transactional key value database powered by Rust and Raft","fork":true,"url":"https://api.github.com/repos/UncP/tikv","forks_url":"https://api.github.com/repos/UncP/tikv/forks","keys_url":"https://api.github.com/repos/UncP/tikv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UncP/tikv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UncP/tikv/teams","hooks_url":"https://api.github.com/repos/UncP/tikv/hooks","issue_events_url":"https://api.github.com/repos/UncP/tikv/issues/events{/number}","events_url":"https://api.github.com/repos/UncP/tikv/events","assignees_url":"https://api.github.com/repos/UncP/tikv/assignees{/user}","branches_url":"https://api.github.com/repos/UncP/tikv/branches{/branch}","tags_url":"https://api.github.com/repos/UncP/tikv/tags","blobs_url":"https://api.github.com/repos/UncP/tikv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UncP/tikv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UncP/tikv/git/refs{/sha}","trees_url":"https://api.github.com/repos/UncP/tikv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UncP/tikv/statuses/{sha}","languages_url":"https://api.github.com/repos/UncP/tikv/languages","stargazers_url":"https://api.github.com/repos/UncP/tikv/stargazers","contributors_url":"https://api.github.com/repos/UncP/tikv/contributors","subscribers_url":"https://api.github.com/repos/UncP/tikv/subscribers","subscription_url":"https://api.github.com/repos/UncP/tikv/subscription","commits_url":"https://api.github.com/repos/UncP/tikv/commits{/sha}","git_commits_url":"https://api.github.com/repos/UncP/tikv/git/commits{/sha}","comments_url":"https://api.github.com/repos/UncP/tikv/comments{/number}","issue_comment_url":"https://api.github.com/repos/UncP/tikv/issues/comments{/number}","contents_url":"https://api.github.com/repos/UncP/tikv/contents/{+path}","compare_url":"https://api.github.com/repos/UncP/tikv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UncP/tikv/merges","archive_url":"https://api.github.com/repos/UncP/tikv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UncP/tikv/downloads","issues_url":"https://api.github.com/repos/UncP/tikv/issues{/number}","pulls_url":"https://api.github.com/repos/UncP/tikv/pulls{/number}","milestones_url":"https://api.github.com/repos/UncP/tikv/milestones{/number}","notifications_url":"https://api.github.com/repos/UncP/tikv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UncP/tikv/labels{/name}","releases_url":"https://api.github.com/repos/UncP/tikv/releases{/id}","deployments_url":"https://api.github.com/repos/UncP/tikv/deployments","created_at":"2017-11-27T02:17:29Z","updated_at":"2017-11-27T02:17:32Z","pushed_at":"2018-02-06T04:49:59Z","git_url":"git://github.com/UncP/tikv.git","ssh_url":"git@github.com:UncP/tikv.git","clone_url":"https://github.com/UncP/tikv.git","svn_url":"https://github.com/UncP/tikv","homepage":"https://pingcap.com","size":12460,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pingcap:master","ref":"master","sha":"9a7c6a55bdc26d8d906129774dd161f0afe45b44","user":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"repo":{"id":48833910,"name":"tikv","full_name":"pingcap/tikv","owner":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pingcap/tikv","description":"Distributed transactional key value database powered by Rust and Raft","fork":false,"url":"https://api.github.com/repos/pingcap/tikv","forks_url":"https://api.github.com/repos/pingcap/tikv/forks","keys_url":"https://api.github.com/repos/pingcap/tikv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingcap/tikv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingcap/tikv/teams","hooks_url":"https://api.github.com/repos/pingcap/tikv/hooks","issue_events_url":"https://api.github.com/repos/pingcap/tikv/issues/events{/number}","events_url":"https://api.github.com/repos/pingcap/tikv/events","assignees_url":"https://api.github.com/repos/pingcap/tikv/assignees{/user}","branches_url":"https://api.github.com/repos/pingcap/tikv/branches{/branch}","tags_url":"https://api.github.com/repos/pingcap/tikv/tags","blobs_url":"https://api.github.com/repos/pingcap/tikv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingcap/tikv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingcap/tikv/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingcap/tikv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingcap/tikv/statuses/{sha}","languages_url":"https://api.github.com/repos/pingcap/tikv/languages","stargazers_url":"https://api.github.com/repos/pingcap/tikv/stargazers","contributors_url":"https://api.github.com/repos/pingcap/tikv/contributors","subscribers_url":"https://api.github.com/repos/pingcap/tikv/subscribers","subscription_url":"https://api.github.com/repos/pingcap/tikv/subscription","commits_url":"https://api.github.com/repos/pingcap/tikv/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingcap/tikv/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingcap/tikv/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingcap/tikv/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingcap/tikv/contents/{+path}","compare_url":"https://api.github.com/repos/pingcap/tikv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingcap/tikv/merges","archive_url":"https://api.github.com/repos/pingcap/tikv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingcap/tikv/downloads","issues_url":"https://api.github.com/repos/pingcap/tikv/issues{/number}","pulls_url":"https://api.github.com/repos/pingcap/tikv/pulls{/number}","milestones_url":"https://api.github.com/repos/pingcap/tikv/milestones{/number}","notifications_url":"https://api.github.com/repos/pingcap/tikv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingcap/tikv/labels{/name}","releases_url":"https://api.github.com/repos/pingcap/tikv/releases{/id}","deployments_url":"https://api.github.com/repos/pingcap/tikv/deployments","created_at":"2015-12-31T04:51:32Z","updated_at":"2018-02-06T06:20:20Z","pushed_at":"2018-02-06T04:50:00Z","git_url":"git://github.com/pingcap/tikv.git","ssh_url":"git@github.com:pingcap/tikv.git","clone_url":"https://github.com/pingcap/tikv.git","svn_url":"https://github.com/pingcap/tikv","homepage":"https://pingcap.com","size":11865,"stargazers_count":2691,"watchers_count":2691,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":330,"mirror_url":null,"archived":false,"open_issues_count":165,"license":null,"forks":330,"open_issues":165,"watchers":2691,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/2736"},"html":{"href":"https://github.com/pingcap/tikv/pull/2736"},"issue":{"href":"https://api.github.com/repos/pingcap/tikv/issues/2736"},"comments":{"href":"https://api.github.com/repos/pingcap/tikv/issues/2736/comments"},"review_comments":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/2736/comments"},"review_comment":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/2736/commits"},"statuses":{"href":"https://api.github.com/repos/pingcap/tikv/statuses/bcff24db0110132eb3e9a9ee5564c8fa96607e33"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"zhangjinpeng1987"}}