{"action":"created","comment":{"url":"https://api.github.com/repos/coreos/etcd/pulls/comments/64915339","id":64915339,"diff_hunk":"@@ -1225,6 +1225,126 @@ func TestLeaderStepdownWhenQuorumLost(t *testing.T) {\n \t}\n }\n \n+func TestLeaderSupersedingWithoutCheckQuorum(t *testing.T) {\n+\ta := newTestRaft(1, []uint64{1, 2, 3}, 10, 1, NewMemoryStorage())\n+\tb := newTestRaft(2, []uint64{1, 2, 3}, 10, 1, NewMemoryStorage())\n+\tc := newTestRaft(3, []uint64{1, 2, 3}, 10, 1, NewMemoryStorage())\n+\n+\tnt := newNetwork(a, b, c)\n+\tnt.send(pb.Message{From: 1, To: 1, Type: pb.MsgHup})\n+\tif c.state != StateFollower {\n+\t\tt.Errorf(\"state = %s, want %s\", c.state, StateFollower)\n+\t}\n+\n+\tnt.isolate(1)\n+\n+\tnt.send(pb.Message{From: 3, To: 3, Type: pb.MsgHup})\n+\tif c.state != StateLeader {\n+\t\tt.Errorf(\"state = %s, want %s\", c.state, StateLeader)\n+\t}\n+}\n+\n+func TestLeaderSupersedingWithCheckQuorum(t *testing.T) {\n+\ta := newTestRaft(1, []uint64{1, 2, 3}, 10, 1, NewMemoryStorage())\n+\tb := newTestRaft(2, []uint64{1, 2, 3}, 10, 1, NewMemoryStorage())\n+\tc := newTestRaft(3, []uint64{1, 2, 3}, 10, 1, NewMemoryStorage())\n+\n+\ta.checkQuorum = true\n+\tb.checkQuorum = true\n+\tc.checkQuorum = true\n+\n+\tnt := newNetwork(a, b, c)\n+\tb.electionElapsed = b.electionTimeout\n+\tnt.send(pb.Message{From: 1, To: 1, Type: pb.MsgHup})\n+\n+\tif a.state != StateLeader {\n+\t\tt.Errorf(\"state = %s, want %s\", a.state, StateLeader)\n+\t}\n+\n+\tif c.state != StateFollower {\n+\t\tt.Errorf(\"state = %s, want %s\", c.state, StateFollower)\n+\t}\n+\n+\tnt.isolate(1)","path":"raft/raft_test.go","position":15,"original_position":44,"commit_id":"de9faa0eb0936b815ff51a408b845770cfd620da","original_commit_id":"de9faa0eb0936b815ff51a408b845770cfd620da","user":{"login":"xiang90","id":4479947,"avatar_url":"https://avatars.githubusercontent.com/u/4479947?v=3","gravatar_id":"","url":"https://api.github.com/users/xiang90","html_url":"https://github.com/xiang90","followers_url":"https://api.github.com/users/xiang90/followers","following_url":"https://api.github.com/users/xiang90/following{/other_user}","gists_url":"https://api.github.com/users/xiang90/gists{/gist_id}","starred_url":"https://api.github.com/users/xiang90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiang90/subscriptions","organizations_url":"https://api.github.com/users/xiang90/orgs","repos_url":"https://api.github.com/users/xiang90/repos","events_url":"https://api.github.com/users/xiang90/events{/privacy}","received_events_url":"https://api.github.com/users/xiang90/received_events","type":"User","site_admin":false},"body":"probably we do not need to isolate 1 if we fix the if statement to include leader state checking.","created_at":"2016-05-27T14:43:49Z","updated_at":"2016-05-27T14:43:49Z","html_url":"https://github.com/coreos/etcd/pull/5468#discussion_r64915339","pull_request_url":"https://api.github.com/repos/coreos/etcd/pulls/5468","_links":{"self":{"href":"https://api.github.com/repos/coreos/etcd/pulls/comments/64915339"},"html":{"href":"https://github.com/coreos/etcd/pull/5468#discussion_r64915339"},"pull_request":{"href":"https://api.github.com/repos/coreos/etcd/pulls/5468"}}},"pull_request":{"url":"https://api.github.com/repos/coreos/etcd/pulls/5468","id":71683697,"html_url":"https://github.com/coreos/etcd/pull/5468","diff_url":"https://github.com/coreos/etcd/pull/5468.diff","patch_url":"https://github.com/coreos/etcd/pull/5468.patch","issue_url":"https://api.github.com/repos/coreos/etcd/issues/5468","number":5468,"state":"open","locked":false,"title":"implemented leader lease when quorum check is on.","user":{"login":"swingbach","id":788701,"avatar_url":"https://avatars.githubusercontent.com/u/788701?v=3","gravatar_id":"","url":"https://api.github.com/users/swingbach","html_url":"https://github.com/swingbach","followers_url":"https://api.github.com/users/swingbach/followers","following_url":"https://api.github.com/users/swingbach/following{/other_user}","gists_url":"https://api.github.com/users/swingbach/gists{/gist_id}","starred_url":"https://api.github.com/users/swingbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swingbach/subscriptions","organizations_url":"https://api.github.com/users/swingbach/orgs","repos_url":"https://api.github.com/users/swingbach/repos","events_url":"https://api.github.com/users/swingbach/events{/privacy}","received_events_url":"https://api.github.com/users/swingbach/received_events","type":"User","site_admin":false},"body":"Make the check quorum mechanism behaves more like a leader lease, also solve stuck peer problem\r\n\r\nsee also [pr 5451](https://github.com/coreos/etcd/pull/5451)\r\n\r\n","created_at":"2016-05-27T09:19:57Z","updated_at":"2016-05-27T14:43:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b36d49dad17ead268626142616f13691e12fa596","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/coreos/etcd/pulls/5468/commits","review_comments_url":"https://api.github.com/repos/coreos/etcd/pulls/5468/comments","review_comment_url":"https://api.github.com/repos/coreos/etcd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coreos/etcd/issues/5468/comments","statuses_url":"https://api.github.com/repos/coreos/etcd/statuses/de9faa0eb0936b815ff51a408b845770cfd620da","head":{"label":"swingbach:master","ref":"master","sha":"de9faa0eb0936b815ff51a408b845770cfd620da","user":{"login":"swingbach","id":788701,"avatar_url":"https://avatars.githubusercontent.com/u/788701?v=3","gravatar_id":"","url":"https://api.github.com/users/swingbach","html_url":"https://github.com/swingbach","followers_url":"https://api.github.com/users/swingbach/followers","following_url":"https://api.github.com/users/swingbach/following{/other_user}","gists_url":"https://api.github.com/users/swingbach/gists{/gist_id}","starred_url":"https://api.github.com/users/swingbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swingbach/subscriptions","organizations_url":"https://api.github.com/users/swingbach/orgs","repos_url":"https://api.github.com/users/swingbach/repos","events_url":"https://api.github.com/users/swingbach/events{/privacy}","received_events_url":"https://api.github.com/users/swingbach/received_events","type":"User","site_admin":false},"repo":{"id":59806276,"name":"etcd","full_name":"swingbach/etcd","owner":{"login":"swingbach","id":788701,"avatar_url":"https://avatars.githubusercontent.com/u/788701?v=3","gravatar_id":"","url":"https://api.github.com/users/swingbach","html_url":"https://github.com/swingbach","followers_url":"https://api.github.com/users/swingbach/followers","following_url":"https://api.github.com/users/swingbach/following{/other_user}","gists_url":"https://api.github.com/users/swingbach/gists{/gist_id}","starred_url":"https://api.github.com/users/swingbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swingbach/subscriptions","organizations_url":"https://api.github.com/users/swingbach/orgs","repos_url":"https://api.github.com/users/swingbach/repos","events_url":"https://api.github.com/users/swingbach/events{/privacy}","received_events_url":"https://api.github.com/users/swingbach/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/swingbach/etcd","description":"Distributed reliable key-value store for the most critical data of a distributed system","fork":true,"url":"https://api.github.com/repos/swingbach/etcd","forks_url":"https://api.github.com/repos/swingbach/etcd/forks","keys_url":"https://api.github.com/repos/swingbach/etcd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swingbach/etcd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swingbach/etcd/teams","hooks_url":"https://api.github.com/repos/swingbach/etcd/hooks","issue_events_url":"https://api.github.com/repos/swingbach/etcd/issues/events{/number}","events_url":"https://api.github.com/repos/swingbach/etcd/events","assignees_url":"https://api.github.com/repos/swingbach/etcd/assignees{/user}","branches_url":"https://api.github.com/repos/swingbach/etcd/branches{/branch}","tags_url":"https://api.github.com/repos/swingbach/etcd/tags","blobs_url":"https://api.github.com/repos/swingbach/etcd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swingbach/etcd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swingbach/etcd/git/refs{/sha}","trees_url":"https://api.github.com/repos/swingbach/etcd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swingbach/etcd/statuses/{sha}","languages_url":"https://api.github.com/repos/swingbach/etcd/languages","stargazers_url":"https://api.github.com/repos/swingbach/etcd/stargazers","contributors_url":"https://api.github.com/repos/swingbach/etcd/contributors","subscribers_url":"https://api.github.com/repos/swingbach/etcd/subscribers","subscription_url":"https://api.github.com/repos/swingbach/etcd/subscription","commits_url":"https://api.github.com/repos/swingbach/etcd/commits{/sha}","git_commits_url":"https://api.github.com/repos/swingbach/etcd/git/commits{/sha}","comments_url":"https://api.github.com/repos/swingbach/etcd/comments{/number}","issue_comment_url":"https://api.github.com/repos/swingbach/etcd/issues/comments{/number}","contents_url":"https://api.github.com/repos/swingbach/etcd/contents/{+path}","compare_url":"https://api.github.com/repos/swingbach/etcd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swingbach/etcd/merges","archive_url":"https://api.github.com/repos/swingbach/etcd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swingbach/etcd/downloads","issues_url":"https://api.github.com/repos/swingbach/etcd/issues{/number}","pulls_url":"https://api.github.com/repos/swingbach/etcd/pulls{/number}","milestones_url":"https://api.github.com/repos/swingbach/etcd/milestones{/number}","notifications_url":"https://api.github.com/repos/swingbach/etcd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swingbach/etcd/labels{/name}","releases_url":"https://api.github.com/repos/swingbach/etcd/releases{/id}","deployments_url":"https://api.github.com/repos/swingbach/etcd/deployments","created_at":"2016-05-27T05:20:09Z","updated_at":"2016-05-27T05:20:12Z","pushed_at":"2016-05-27T09:09:36Z","git_url":"git://github.com/swingbach/etcd.git","ssh_url":"git@github.com:swingbach/etcd.git","clone_url":"https://github.com/swingbach/etcd.git","svn_url":"https://github.com/swingbach/etcd","homepage":"https://coreos.com/etcd/docs/latest/","size":25238,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"coreos:master","ref":"master","sha":"3ed5d28e2efb46ef2fc1ce3984a2a1a729cd6c5e","user":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"repo":{"id":11225014,"name":"etcd","full_name":"coreos/etcd","owner":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coreos/etcd","description":"Distributed reliable key-value store for the most critical data of a distributed system","fork":false,"url":"https://api.github.com/repos/coreos/etcd","forks_url":"https://api.github.com/repos/coreos/etcd/forks","keys_url":"https://api.github.com/repos/coreos/etcd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coreos/etcd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coreos/etcd/teams","hooks_url":"https://api.github.com/repos/coreos/etcd/hooks","issue_events_url":"https://api.github.com/repos/coreos/etcd/issues/events{/number}","events_url":"https://api.github.com/repos/coreos/etcd/events","assignees_url":"https://api.github.com/repos/coreos/etcd/assignees{/user}","branches_url":"https://api.github.com/repos/coreos/etcd/branches{/branch}","tags_url":"https://api.github.com/repos/coreos/etcd/tags","blobs_url":"https://api.github.com/repos/coreos/etcd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coreos/etcd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coreos/etcd/git/refs{/sha}","trees_url":"https://api.github.com/repos/coreos/etcd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coreos/etcd/statuses/{sha}","languages_url":"https://api.github.com/repos/coreos/etcd/languages","stargazers_url":"https://api.github.com/repos/coreos/etcd/stargazers","contributors_url":"https://api.github.com/repos/coreos/etcd/contributors","subscribers_url":"https://api.github.com/repos/coreos/etcd/subscribers","subscription_url":"https://api.github.com/repos/coreos/etcd/subscription","commits_url":"https://api.github.com/repos/coreos/etcd/commits{/sha}","git_commits_url":"https://api.github.com/repos/coreos/etcd/git/commits{/sha}","comments_url":"https://api.github.com/repos/coreos/etcd/comments{/number}","issue_comment_url":"https://api.github.com/repos/coreos/etcd/issues/comments{/number}","contents_url":"https://api.github.com/repos/coreos/etcd/contents/{+path}","compare_url":"https://api.github.com/repos/coreos/etcd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coreos/etcd/merges","archive_url":"https://api.github.com/repos/coreos/etcd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coreos/etcd/downloads","issues_url":"https://api.github.com/repos/coreos/etcd/issues{/number}","pulls_url":"https://api.github.com/repos/coreos/etcd/pulls{/number}","milestones_url":"https://api.github.com/repos/coreos/etcd/milestones{/number}","notifications_url":"https://api.github.com/repos/coreos/etcd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coreos/etcd/labels{/name}","releases_url":"https://api.github.com/repos/coreos/etcd/releases{/id}","deployments_url":"https://api.github.com/repos/coreos/etcd/deployments","created_at":"2013-07-06T21:57:21Z","updated_at":"2016-05-27T14:42:29Z","pushed_at":"2016-05-27T14:29:12Z","git_url":"git://github.com/coreos/etcd.git","ssh_url":"git@github.com:coreos/etcd.git","clone_url":"https://github.com/coreos/etcd.git","svn_url":"https://github.com/coreos/etcd","homepage":"https://coreos.com/etcd/docs/latest/","size":31630,"stargazers_count":9718,"watchers_count":9718,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1632,"mirror_url":null,"open_issues_count":141,"forks":1632,"open_issues":141,"watchers":9718,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coreos/etcd/pulls/5468"},"html":{"href":"https://github.com/coreos/etcd/pull/5468"},"issue":{"href":"https://api.github.com/repos/coreos/etcd/issues/5468"},"comments":{"href":"https://api.github.com/repos/coreos/etcd/issues/5468/comments"},"review_comments":{"href":"https://api.github.com/repos/coreos/etcd/pulls/5468/comments"},"review_comment":{"href":"https://api.github.com/repos/coreos/etcd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coreos/etcd/pulls/5468/commits"},"statuses":{"href":"https://api.github.com/repos/coreos/etcd/statuses/de9faa0eb0936b815ff51a408b845770cfd620da"}}}}
{"actor":{"display_login":"xiang90"}}