{"action":"created","comment":{"url":"https://api.github.com/repos/pingcap/tikv/pulls/comments/73825766","id":73825766,"diff_hunk":"@@ -513,6 +532,21 @@ impl Peer {\n         Ok(())\n     }\n \n+    fn use_local_read(&self, req: &RaftCmdRequest) -> bool {\n+        if !req.has_header() || !req.get_header().has_read_quorum() ||","path":"src/raftstore/store/peer.rs","position":33,"original_position":33,"commit_id":"04c71e18e479d89a87ac7f708981c6522f68ff74","original_commit_id":"04c71e18e479d89a87ac7f708981c6522f68ff74","user":{"login":"BusyJay","id":1701473,"avatar_url":"https://avatars.githubusercontent.com/u/1701473?v=3","gravatar_id":"","url":"https://api.github.com/users/BusyJay","html_url":"https://github.com/BusyJay","followers_url":"https://api.github.com/users/BusyJay/followers","following_url":"https://api.github.com/users/BusyJay/following{/other_user}","gists_url":"https://api.github.com/users/BusyJay/gists{/gist_id}","starred_url":"https://api.github.com/users/BusyJay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BusyJay/subscriptions","organizations_url":"https://api.github.com/users/BusyJay/orgs","repos_url":"https://api.github.com/users/BusyJay/repos","events_url":"https://api.github.com/users/BusyJay/events{/privacy}","received_events_url":"https://api.github.com/users/BusyJay/received_events","type":"User","site_admin":false},"body":"`req.has_header() || !req.get_header().has_read_quorum() || req.get_header().get_read_quorum()` can be collapsed as `req.get_header().get_read_quorum()`.","created_at":"2016-08-08T06:04:55Z","updated_at":"2016-08-08T06:04:55Z","html_url":"https://github.com/pingcap/tikv/pull/916#discussion_r73825766","pull_request_url":"https://api.github.com/repos/pingcap/tikv/pulls/916","_links":{"self":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/comments/73825766"},"html":{"href":"https://github.com/pingcap/tikv/pull/916#discussion_r73825766"},"pull_request":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/916"}}},"pull_request":{"url":"https://api.github.com/repos/pingcap/tikv/pulls/916","id":80210578,"html_url":"https://github.com/pingcap/tikv/pull/916","diff_url":"https://github.com/pingcap/tikv/pull/916.diff","patch_url":"https://github.com/pingcap/tikv/pull/916.patch","issue_url":"https://api.github.com/repos/pingcap/tikv/issues/916","number":916,"state":"open","locked":false,"title":"*: local read when in leader's lease","user":{"login":"zhangjinpeng1987","id":19700528,"avatar_url":"https://avatars.githubusercontent.com/u/19700528?v=3","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":"Implemented local read when in leader's lease with check_quorum is on.","created_at":"2016-08-05T08:58:43Z","updated_at":"2016-08-08T06:04:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68d74a130cfc8b4b811356da55df4791cff1a920","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pingcap/tikv/pulls/916/commits","review_comments_url":"https://api.github.com/repos/pingcap/tikv/pulls/916/comments","review_comment_url":"https://api.github.com/repos/pingcap/tikv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pingcap/tikv/issues/916/comments","statuses_url":"https://api.github.com/repos/pingcap/tikv/statuses/04c71e18e479d89a87ac7f708981c6522f68ff74","head":{"label":"pingcap:zhangjinpeng/local-read-in-lease","ref":"zhangjinpeng/local-read-in-lease","sha":"04c71e18e479d89a87ac7f708981c6522f68ff74","user":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars.githubusercontent.com/u/11855343?v=3","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://avatars.githubusercontent.com/u/11855343?v=3","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":"2016-08-08T04:13:38Z","pushed_at":"2016-08-08T05:06:01Z","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":"","size":5136,"stargazers_count":866,"watchers_count":866,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":68,"mirror_url":null,"open_issues_count":32,"forks":68,"open_issues":32,"watchers":866,"default_branch":"master"}},"base":{"label":"pingcap:master","ref":"master","sha":"6bf919891928efb5ea9393a5c71c5c9ca7ed0beb","user":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars.githubusercontent.com/u/11855343?v=3","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://avatars.githubusercontent.com/u/11855343?v=3","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":"2016-08-08T04:13:38Z","pushed_at":"2016-08-08T05:06:01Z","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":"","size":5136,"stargazers_count":866,"watchers_count":866,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":68,"mirror_url":null,"open_issues_count":32,"forks":68,"open_issues":32,"watchers":866,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/916"},"html":{"href":"https://github.com/pingcap/tikv/pull/916"},"issue":{"href":"https://api.github.com/repos/pingcap/tikv/issues/916"},"comments":{"href":"https://api.github.com/repos/pingcap/tikv/issues/916/comments"},"review_comments":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/916/comments"},"review_comment":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/916/commits"},"statuses":{"href":"https://api.github.com/repos/pingcap/tikv/statuses/04c71e18e479d89a87ac7f708981c6522f68ff74"}}}}
{"actor":{"display_login":"BusyJay"}}