{"action":"created","comment":{"url":"https://api.github.com/repos/docker/swarmkit/pulls/comments/81252233","pull_request_review_id":2246731,"id":81252233,"diff_hunk":"@@ -461,14 +457,16 @@ func (n *Node) Run(ctx context.Context) error {\n \t\t\t// If we are the only registered member after\n \t\t\t// restoring from the state, campaign to be the\n \t\t\t// leader.\n-\t\t\tif !n.restored {\n-\t\t\t\t// Node ID should be in the progress list to Campaign\n-\t\t\t\tif len(n.cluster.Members()) <= 1 {\n+\t\t\tif n.campaignWhenAble {\n+\t\t\t\tmembers := n.cluster.Members()","path":"manager/state/raft/raft.go","position":39,"original_position":39,"commit_id":"50921a9a0508cbee64469052697705e39f393829","original_commit_id":"50921a9a0508cbee64469052697705e39f393829","user":{"login":"LK4D4","id":101445,"avatar_url":"https://avatars.githubusercontent.com/u/101445?v=3","gravatar_id":"","url":"https://api.github.com/users/LK4D4","html_url":"https://github.com/LK4D4","followers_url":"https://api.github.com/users/LK4D4/followers","following_url":"https://api.github.com/users/LK4D4/following{/other_user}","gists_url":"https://api.github.com/users/LK4D4/gists{/gist_id}","starred_url":"https://api.github.com/users/LK4D4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LK4D4/subscriptions","organizations_url":"https://api.github.com/users/LK4D4/orgs","repos_url":"https://api.github.com/users/LK4D4/repos","events_url":"https://api.github.com/users/LK4D4/events{/privacy}","received_events_url":"https://api.github.com/users/LK4D4/received_events","type":"User","site_admin":false},"body":"I wonder why not just campaign once if you're sole member?","created_at":"2016-09-29T22:59:06Z","updated_at":"2016-09-29T22:59:06Z","html_url":"https://github.com/docker/swarmkit/pull/1589#discussion_r81252233","pull_request_url":"https://api.github.com/repos/docker/swarmkit/pulls/1589","_links":{"self":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/comments/81252233"},"html":{"href":"https://github.com/docker/swarmkit/pull/1589#discussion_r81252233"},"pull_request":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/1589"}}},"pull_request":{"url":"https://api.github.com/repos/docker/swarmkit/pulls/1589","id":87361403,"html_url":"https://github.com/docker/swarmkit/pull/1589","diff_url":"https://github.com/docker/swarmkit/pull/1589.diff","patch_url":"https://github.com/docker/swarmkit/pull/1589.patch","issue_url":"https://api.github.com/repos/docker/swarmkit/issues/1589","number":1589,"state":"open","locked":false,"title":"raft: Forward-port improvements to campaign on restart","user":{"login":"aaronlehmann","id":10601430,"avatar_url":"https://avatars.githubusercontent.com/u/10601430?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronlehmann","html_url":"https://github.com/aaronlehmann","followers_url":"https://api.github.com/users/aaronlehmann/followers","following_url":"https://api.github.com/users/aaronlehmann/following{/other_user}","gists_url":"https://api.github.com/users/aaronlehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronlehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronlehmann/subscriptions","organizations_url":"https://api.github.com/users/aaronlehmann/orgs","repos_url":"https://api.github.com/users/aaronlehmann/repos","events_url":"https://api.github.com/users/aaronlehmann/events{/privacy}","received_events_url":"https://api.github.com/users/aaronlehmann/received_events","type":"User","site_admin":false},"body":"This brings the code on master in sync with the 1.12 changes in #1588. The code on master does not have the same problem (since a newer etcd/raft library lets it skip the problematic check), but the version being adopted by 1.12 should be a bit more robust.\r\n\r\nThis is a separate PR against master instead of cherry-picking from master to bump_v1.12.2 because the code has diverged and needs to be a bit different on master anyway (different etcd/raft version).\r\n\r\ncc @LK4D4 @mrjana","created_at":"2016-09-29T17:52:09Z","updated_at":"2016-09-29T22:59:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f973ec45c05195af77d409358c7bae2fa880aba","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/docker/swarmkit/pulls/1589/commits","review_comments_url":"https://api.github.com/repos/docker/swarmkit/pulls/1589/comments","review_comment_url":"https://api.github.com/repos/docker/swarmkit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/swarmkit/issues/1589/comments","statuses_url":"https://api.github.com/repos/docker/swarmkit/statuses/50921a9a0508cbee64469052697705e39f393829","head":{"label":"aaronlehmann:fix-campaign-on-restart-master","ref":"fix-campaign-on-restart-master","sha":"50921a9a0508cbee64469052697705e39f393829","user":{"login":"aaronlehmann","id":10601430,"avatar_url":"https://avatars.githubusercontent.com/u/10601430?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronlehmann","html_url":"https://github.com/aaronlehmann","followers_url":"https://api.github.com/users/aaronlehmann/followers","following_url":"https://api.github.com/users/aaronlehmann/following{/other_user}","gists_url":"https://api.github.com/users/aaronlehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronlehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronlehmann/subscriptions","organizations_url":"https://api.github.com/users/aaronlehmann/orgs","repos_url":"https://api.github.com/users/aaronlehmann/repos","events_url":"https://api.github.com/users/aaronlehmann/events{/privacy}","received_events_url":"https://api.github.com/users/aaronlehmann/received_events","type":"User","site_admin":false},"repo":{"id":61081831,"name":"swarmkit","full_name":"aaronlehmann/swarmkit","owner":{"login":"aaronlehmann","id":10601430,"avatar_url":"https://avatars.githubusercontent.com/u/10601430?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronlehmann","html_url":"https://github.com/aaronlehmann","followers_url":"https://api.github.com/users/aaronlehmann/followers","following_url":"https://api.github.com/users/aaronlehmann/following{/other_user}","gists_url":"https://api.github.com/users/aaronlehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronlehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronlehmann/subscriptions","organizations_url":"https://api.github.com/users/aaronlehmann/orgs","repos_url":"https://api.github.com/users/aaronlehmann/repos","events_url":"https://api.github.com/users/aaronlehmann/events{/privacy}","received_events_url":"https://api.github.com/users/aaronlehmann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aaronlehmann/swarmkit","description":"A toolkit for orchestrating distributed systems at any scale. It includes primitives for node discovery, raft-based consensus, task scheduling and more.","fork":true,"url":"https://api.github.com/repos/aaronlehmann/swarmkit","forks_url":"https://api.github.com/repos/aaronlehmann/swarmkit/forks","keys_url":"https://api.github.com/repos/aaronlehmann/swarmkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aaronlehmann/swarmkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aaronlehmann/swarmkit/teams","hooks_url":"https://api.github.com/repos/aaronlehmann/swarmkit/hooks","issue_events_url":"https://api.github.com/repos/aaronlehmann/swarmkit/issues/events{/number}","events_url":"https://api.github.com/repos/aaronlehmann/swarmkit/events","assignees_url":"https://api.github.com/repos/aaronlehmann/swarmkit/assignees{/user}","branches_url":"https://api.github.com/repos/aaronlehmann/swarmkit/branches{/branch}","tags_url":"https://api.github.com/repos/aaronlehmann/swarmkit/tags","blobs_url":"https://api.github.com/repos/aaronlehmann/swarmkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aaronlehmann/swarmkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aaronlehmann/swarmkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/aaronlehmann/swarmkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aaronlehmann/swarmkit/statuses/{sha}","languages_url":"https://api.github.com/repos/aaronlehmann/swarmkit/languages","stargazers_url":"https://api.github.com/repos/aaronlehmann/swarmkit/stargazers","contributors_url":"https://api.github.com/repos/aaronlehmann/swarmkit/contributors","subscribers_url":"https://api.github.com/repos/aaronlehmann/swarmkit/subscribers","subscription_url":"https://api.github.com/repos/aaronlehmann/swarmkit/subscription","commits_url":"https://api.github.com/repos/aaronlehmann/swarmkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/aaronlehmann/swarmkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/aaronlehmann/swarmkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/aaronlehmann/swarmkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/aaronlehmann/swarmkit/contents/{+path}","compare_url":"https://api.github.com/repos/aaronlehmann/swarmkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aaronlehmann/swarmkit/merges","archive_url":"https://api.github.com/repos/aaronlehmann/swarmkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aaronlehmann/swarmkit/downloads","issues_url":"https://api.github.com/repos/aaronlehmann/swarmkit/issues{/number}","pulls_url":"https://api.github.com/repos/aaronlehmann/swarmkit/pulls{/number}","milestones_url":"https://api.github.com/repos/aaronlehmann/swarmkit/milestones{/number}","notifications_url":"https://api.github.com/repos/aaronlehmann/swarmkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aaronlehmann/swarmkit/labels{/name}","releases_url":"https://api.github.com/repos/aaronlehmann/swarmkit/releases{/id}","deployments_url":"https://api.github.com/repos/aaronlehmann/swarmkit/deployments","created_at":"2016-06-14T01:29:55Z","updated_at":"2016-06-14T01:29:56Z","pushed_at":"2016-09-29T22:51:36Z","git_url":"git://github.com/aaronlehmann/swarmkit.git","ssh_url":"git@github.com:aaronlehmann/swarmkit.git","clone_url":"https://github.com/aaronlehmann/swarmkit.git","svn_url":"https://github.com/aaronlehmann/swarmkit","homepage":"","size":10619,"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":"docker:master","ref":"master","sha":"43aeea7a4498e42d8a126f618ef32850852a2095","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":51556828,"name":"swarmkit","full_name":"docker/swarmkit","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/swarmkit","description":"A toolkit for orchestrating distributed systems at any scale. It includes primitives for node discovery, raft-based consensus, task scheduling and more.","fork":false,"url":"https://api.github.com/repos/docker/swarmkit","forks_url":"https://api.github.com/repos/docker/swarmkit/forks","keys_url":"https://api.github.com/repos/docker/swarmkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/swarmkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/swarmkit/teams","hooks_url":"https://api.github.com/repos/docker/swarmkit/hooks","issue_events_url":"https://api.github.com/repos/docker/swarmkit/issues/events{/number}","events_url":"https://api.github.com/repos/docker/swarmkit/events","assignees_url":"https://api.github.com/repos/docker/swarmkit/assignees{/user}","branches_url":"https://api.github.com/repos/docker/swarmkit/branches{/branch}","tags_url":"https://api.github.com/repos/docker/swarmkit/tags","blobs_url":"https://api.github.com/repos/docker/swarmkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/swarmkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/swarmkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/swarmkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/swarmkit/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/swarmkit/languages","stargazers_url":"https://api.github.com/repos/docker/swarmkit/stargazers","contributors_url":"https://api.github.com/repos/docker/swarmkit/contributors","subscribers_url":"https://api.github.com/repos/docker/swarmkit/subscribers","subscription_url":"https://api.github.com/repos/docker/swarmkit/subscription","commits_url":"https://api.github.com/repos/docker/swarmkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/swarmkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/swarmkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/swarmkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/swarmkit/contents/{+path}","compare_url":"https://api.github.com/repos/docker/swarmkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/swarmkit/merges","archive_url":"https://api.github.com/repos/docker/swarmkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/swarmkit/downloads","issues_url":"https://api.github.com/repos/docker/swarmkit/issues{/number}","pulls_url":"https://api.github.com/repos/docker/swarmkit/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/swarmkit/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/swarmkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/swarmkit/labels{/name}","releases_url":"https://api.github.com/repos/docker/swarmkit/releases{/id}","deployments_url":"https://api.github.com/repos/docker/swarmkit/deployments","created_at":"2016-02-12T00:02:15Z","updated_at":"2016-09-29T15:41:49Z","pushed_at":"2016-09-29T22:51:36Z","git_url":"git://github.com/docker/swarmkit.git","ssh_url":"git@github.com:docker/swarmkit.git","clone_url":"https://github.com/docker/swarmkit.git","svn_url":"https://github.com/docker/swarmkit","homepage":"","size":21758,"stargazers_count":954,"watchers_count":954,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":189,"mirror_url":null,"open_issues_count":181,"forks":189,"open_issues":181,"watchers":954,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/1589"},"html":{"href":"https://github.com/docker/swarmkit/pull/1589"},"issue":{"href":"https://api.github.com/repos/docker/swarmkit/issues/1589"},"comments":{"href":"https://api.github.com/repos/docker/swarmkit/issues/1589/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/1589/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/1589/commits"},"statuses":{"href":"https://api.github.com/repos/docker/swarmkit/statuses/50921a9a0508cbee64469052697705e39f393829"}}}}
{"actor":{"display_login":"LK4D4"}}