{"action":"created","comment":{"url":"https://api.github.com/repos/coreos/etcd/pulls/comments/84728826","pull_request_review_id":5488138,"id":84728826,"diff_hunk":"@@ -679,7 +733,48 @@ func (r *raft) Step(m pb.Message) error {\n \t\t}\n \t\treturn nil\n \t}\n-\tr.step(r, m)\n+\n+\tswitch m.Type {\n+\tcase pb.MsgHup:\n+\t\tif r.state != StateLeader {\n+\t\t\tents, err := r.raftLog.slice(r.raftLog.applied+1, r.raftLog.committed+1, noLimit)\n+\t\t\tif err != nil {\n+\t\t\t\tr.logger.Panicf(\"unexpected error getting unapplied entries (%v)\", err)\n+\t\t\t}\n+\t\t\tif n := numOfPendingConf(ents); n != 0 && r.raftLog.committed > r.raftLog.applied {\n+\t\t\t\tr.logger.Warningf(\"%x cannot campaign at term %d since there are still %d pending configuration changes to apply\", r.id, r.Term, n)\n+\t\t\t\treturn nil\n+\t\t\t}\n+\n+\t\t\tr.logger.Infof(\"%x is starting a new election at term %d\", r.id, r.Term)\n+\t\t\tif r.preVote {\n+\t\t\t\tr.campaign(campaignPreElection)\n+\t\t\t} else {\n+\t\t\t\tr.campaign(campaignElection)\n+\t\t\t}\n+\t\t} else {\n+\t\t\tr.logger.Debugf(\"%x ignoring MsgHup because already leader\", r.id)\n+\t\t}\n+\n+\tcase pb.MsgVote, pb.MsgPreVote:","path":"raft/raft.go","position":282,"original_position":282,"commit_id":"22aa710c1f36743452dad4b017f8e8a9cf4f0076","original_commit_id":"cf93a74aa87081b88e57568eb1069c06b5b1c17a","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":"No strong opinion here. One reason to keep it separate is to make the changes set minimal. It would be easier for tikv (@ngaut @siddontang @hhkbp2) guys to port. But I guess it wont cause a lot of troubles anyway.","created_at":"2016-10-24T16:37:26Z","updated_at":"2016-10-24T16:37:26Z","html_url":"https://github.com/coreos/etcd/pull/6624#discussion_r84728826","pull_request_url":"https://api.github.com/repos/coreos/etcd/pulls/6624","_links":{"self":{"href":"https://api.github.com/repos/coreos/etcd/pulls/comments/84728826"},"html":{"href":"https://github.com/coreos/etcd/pull/6624#discussion_r84728826"},"pull_request":{"href":"https://api.github.com/repos/coreos/etcd/pulls/6624"}}},"pull_request":{"url":"https://api.github.com/repos/coreos/etcd/pulls/6624","id":88819138,"html_url":"https://github.com/coreos/etcd/pull/6624","diff_url":"https://github.com/coreos/etcd/pull/6624.diff","patch_url":"https://github.com/coreos/etcd/pull/6624.patch","issue_url":"https://api.github.com/repos/coreos/etcd/issues/6624","number":6624,"state":"open","locked":false,"title":"raft: Implement the PreVote RPC described in thesis section 9.6","user":{"login":"bdarnell","id":160562,"avatar_url":"https://avatars.githubusercontent.com/u/160562?v=3","gravatar_id":"","url":"https://api.github.com/users/bdarnell","html_url":"https://github.com/bdarnell","followers_url":"https://api.github.com/users/bdarnell/followers","following_url":"https://api.github.com/users/bdarnell/following{/other_user}","gists_url":"https://api.github.com/users/bdarnell/gists{/gist_id}","starred_url":"https://api.github.com/users/bdarnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdarnell/subscriptions","organizations_url":"https://api.github.com/users/bdarnell/orgs","repos_url":"https://api.github.com/users/bdarnell/repos","events_url":"https://api.github.com/users/bdarnell/events{/privacy}","received_events_url":"https://api.github.com/users/bdarnell/received_events","type":"User","site_admin":false},"body":"This prevents disruption when a node that has been partitioned\r\naway rejoins the cluster.\r\n\r\nFixes #6522","created_at":"2016-10-11T12:00:36Z","updated_at":"2016-10-24T16:37:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ba7c1ba7a986f971d3ea3833dca031b63021be65","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/coreos/etcd/pulls/6624/commits","review_comments_url":"https://api.github.com/repos/coreos/etcd/pulls/6624/comments","review_comment_url":"https://api.github.com/repos/coreos/etcd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coreos/etcd/issues/6624/comments","statuses_url":"https://api.github.com/repos/coreos/etcd/statuses/22aa710c1f36743452dad4b017f8e8a9cf4f0076","head":{"label":"bdarnell:pre-vote","ref":"pre-vote","sha":"22aa710c1f36743452dad4b017f8e8a9cf4f0076","user":{"login":"bdarnell","id":160562,"avatar_url":"https://avatars.githubusercontent.com/u/160562?v=3","gravatar_id":"","url":"https://api.github.com/users/bdarnell","html_url":"https://github.com/bdarnell","followers_url":"https://api.github.com/users/bdarnell/followers","following_url":"https://api.github.com/users/bdarnell/following{/other_user}","gists_url":"https://api.github.com/users/bdarnell/gists{/gist_id}","starred_url":"https://api.github.com/users/bdarnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdarnell/subscriptions","organizations_url":"https://api.github.com/users/bdarnell/orgs","repos_url":"https://api.github.com/users/bdarnell/repos","events_url":"https://api.github.com/users/bdarnell/events{/privacy}","received_events_url":"https://api.github.com/users/bdarnell/received_events","type":"User","site_admin":false},"repo":{"id":24914743,"name":"etcd","full_name":"bdarnell/etcd","owner":{"login":"bdarnell","id":160562,"avatar_url":"https://avatars.githubusercontent.com/u/160562?v=3","gravatar_id":"","url":"https://api.github.com/users/bdarnell","html_url":"https://github.com/bdarnell","followers_url":"https://api.github.com/users/bdarnell/followers","following_url":"https://api.github.com/users/bdarnell/following{/other_user}","gists_url":"https://api.github.com/users/bdarnell/gists{/gist_id}","starred_url":"https://api.github.com/users/bdarnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdarnell/subscriptions","organizations_url":"https://api.github.com/users/bdarnell/orgs","repos_url":"https://api.github.com/users/bdarnell/repos","events_url":"https://api.github.com/users/bdarnell/events{/privacy}","received_events_url":"https://api.github.com/users/bdarnell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bdarnell/etcd","description":"A highly-available key value store for shared configuration and service discovery","fork":true,"url":"https://api.github.com/repos/bdarnell/etcd","forks_url":"https://api.github.com/repos/bdarnell/etcd/forks","keys_url":"https://api.github.com/repos/bdarnell/etcd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bdarnell/etcd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bdarnell/etcd/teams","hooks_url":"https://api.github.com/repos/bdarnell/etcd/hooks","issue_events_url":"https://api.github.com/repos/bdarnell/etcd/issues/events{/number}","events_url":"https://api.github.com/repos/bdarnell/etcd/events","assignees_url":"https://api.github.com/repos/bdarnell/etcd/assignees{/user}","branches_url":"https://api.github.com/repos/bdarnell/etcd/branches{/branch}","tags_url":"https://api.github.com/repos/bdarnell/etcd/tags","blobs_url":"https://api.github.com/repos/bdarnell/etcd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bdarnell/etcd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bdarnell/etcd/git/refs{/sha}","trees_url":"https://api.github.com/repos/bdarnell/etcd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bdarnell/etcd/statuses/{sha}","languages_url":"https://api.github.com/repos/bdarnell/etcd/languages","stargazers_url":"https://api.github.com/repos/bdarnell/etcd/stargazers","contributors_url":"https://api.github.com/repos/bdarnell/etcd/contributors","subscribers_url":"https://api.github.com/repos/bdarnell/etcd/subscribers","subscription_url":"https://api.github.com/repos/bdarnell/etcd/subscription","commits_url":"https://api.github.com/repos/bdarnell/etcd/commits{/sha}","git_commits_url":"https://api.github.com/repos/bdarnell/etcd/git/commits{/sha}","comments_url":"https://api.github.com/repos/bdarnell/etcd/comments{/number}","issue_comment_url":"https://api.github.com/repos/bdarnell/etcd/issues/comments{/number}","contents_url":"https://api.github.com/repos/bdarnell/etcd/contents/{+path}","compare_url":"https://api.github.com/repos/bdarnell/etcd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bdarnell/etcd/merges","archive_url":"https://api.github.com/repos/bdarnell/etcd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bdarnell/etcd/downloads","issues_url":"https://api.github.com/repos/bdarnell/etcd/issues{/number}","pulls_url":"https://api.github.com/repos/bdarnell/etcd/pulls{/number}","milestones_url":"https://api.github.com/repos/bdarnell/etcd/milestones{/number}","notifications_url":"https://api.github.com/repos/bdarnell/etcd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bdarnell/etcd/labels{/name}","releases_url":"https://api.github.com/repos/bdarnell/etcd/releases{/id}","deployments_url":"https://api.github.com/repos/bdarnell/etcd/deployments","created_at":"2014-10-07T22:38:59Z","updated_at":"2014-10-07T21:58:44Z","pushed_at":"2016-10-24T13:29:50Z","git_url":"git://github.com/bdarnell/etcd.git","ssh_url":"git@github.com:bdarnell/etcd.git","clone_url":"https://github.com/bdarnell/etcd.git","svn_url":"https://github.com/bdarnell/etcd","homepage":"","size":24892,"stargazers_count":0,"watchers_count":0,"language":null,"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":"11c38fb1eb3bb32836dd504a1dfa7c5916b1f240","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-10-24T11:55:08Z","pushed_at":"2016-10-24T16:17:30Z","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":32968,"stargazers_count":11198,"watchers_count":11198,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1993,"mirror_url":null,"open_issues_count":132,"forks":1993,"open_issues":132,"watchers":11198,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coreos/etcd/pulls/6624"},"html":{"href":"https://github.com/coreos/etcd/pull/6624"},"issue":{"href":"https://api.github.com/repos/coreos/etcd/issues/6624"},"comments":{"href":"https://api.github.com/repos/coreos/etcd/issues/6624/comments"},"review_comments":{"href":"https://api.github.com/repos/coreos/etcd/pulls/6624/comments"},"review_comment":{"href":"https://api.github.com/repos/coreos/etcd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coreos/etcd/pulls/6624/commits"},"statuses":{"href":"https://api.github.com/repos/coreos/etcd/statuses/22aa710c1f36743452dad4b017f8e8a9cf4f0076"}}}}
{"actor":{"display_login":"xiang90"}}