{"action":"closed","number":3479,"pull_request":{"url":"https://api.github.com/repos/coreos/etcd/pulls/3479","id":44634512,"html_url":"https://github.com/coreos/etcd/pull/3479","diff_url":"https://github.com/coreos/etcd/pull/3479.diff","patch_url":"https://github.com/coreos/etcd/pull/3479.patch","issue_url":"https://api.github.com/repos/coreos/etcd/issues/3479","number":3479,"state":"closed","locked":false,"title":"etcdserver: avoid deadlock caused by adding members with wrong peer URLs","user":{"login":"mitake","id":1173955,"avatar_url":"https://avatars.githubusercontent.com/u/1173955?v=3","gravatar_id":"","url":"https://api.github.com/users/mitake","html_url":"https://github.com/mitake","followers_url":"https://api.github.com/users/mitake/followers","following_url":"https://api.github.com/users/mitake/following{/other_user}","gists_url":"https://api.github.com/users/mitake/gists{/gist_id}","starred_url":"https://api.github.com/users/mitake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitake/subscriptions","organizations_url":"https://api.github.com/users/mitake/orgs","repos_url":"https://api.github.com/users/mitake/repos","events_url":"https://api.github.com/users/mitake/events{/privacy}","received_events_url":"https://api.github.com/users/mitake/received_events","type":"User","site_admin":false},"body":"Current membership changing functionality of etcd seems to have a\r\nproblem which can cause deadlock.\r\n\r\nHow to produce:\r\n 1. construct N node cluster\r\n 2. add N new nodes with etcdctl member add, without starting the new members\r\n\r\nWhat happens:\r\nAfter finishing add N nodes, a total number of the cluster becomes 2 *\r\nN and a quorum number of the cluster becomes N + 1. It means\r\nmembership change requires at least N + 1 nodes because Raft treats\r\nmembership information in its log like other ordinal log append\r\nrequests.\r\n\r\nAssume the peer URLs of the added nodes are wrong because of miss\r\noperation or bugs in wrapping program which launch etcd. In such a\r\ncase, both of adding and removing members are impossible because the\r\nquorum isn't preserved. Of course ordinal requests cannot be\r\nserved. The cluster would seem to be deadlock.\r\n\r\nOf course, the best practice of adding new nodes is adding one node\r\nand let the node start one by one. However, the effect of this problem\r\nis so serious. I think preventing the problem forcibly would be\r\nvaluable.\r\n\r\nSolution:\r\nThis patch lets etcd forbid adding a new node if the operation changes\r\nquorum and the number of changed quorum is larger than a number of\r\nrunning nodes.\r\n\r\nFixes https://github.com/coreos/etcd/issues/3477","created_at":"2015-09-10T07:10:00Z","updated_at":"2015-09-13T05:09:13Z","closed_at":"2015-09-13T05:09:13Z","merged_at":"2015-09-13T05:09:13Z","merge_commit_sha":"a6b6fd85a10fa4801f4fb1c7b5f4a3131f44b585","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/coreos/etcd/pulls/3479/commits","review_comments_url":"https://api.github.com/repos/coreos/etcd/pulls/3479/comments","review_comment_url":"https://api.github.com/repos/coreos/etcd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coreos/etcd/issues/3479/comments","statuses_url":"https://api.github.com/repos/coreos/etcd/statuses/dad32646eb1918c4208c8ac4807cd9e0a2ebe7b7","head":{"label":"mitake:membership","ref":"membership","sha":"dad32646eb1918c4208c8ac4807cd9e0a2ebe7b7","user":{"login":"mitake","id":1173955,"avatar_url":"https://avatars.githubusercontent.com/u/1173955?v=3","gravatar_id":"","url":"https://api.github.com/users/mitake","html_url":"https://github.com/mitake","followers_url":"https://api.github.com/users/mitake/followers","following_url":"https://api.github.com/users/mitake/following{/other_user}","gists_url":"https://api.github.com/users/mitake/gists{/gist_id}","starred_url":"https://api.github.com/users/mitake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitake/subscriptions","organizations_url":"https://api.github.com/users/mitake/orgs","repos_url":"https://api.github.com/users/mitake/repos","events_url":"https://api.github.com/users/mitake/events{/privacy}","received_events_url":"https://api.github.com/users/mitake/received_events","type":"User","site_admin":false},"repo":{"id":40219422,"name":"etcd","full_name":"mitake/etcd","owner":{"login":"mitake","id":1173955,"avatar_url":"https://avatars.githubusercontent.com/u/1173955?v=3","gravatar_id":"","url":"https://api.github.com/users/mitake","html_url":"https://github.com/mitake","followers_url":"https://api.github.com/users/mitake/followers","following_url":"https://api.github.com/users/mitake/following{/other_user}","gists_url":"https://api.github.com/users/mitake/gists{/gist_id}","starred_url":"https://api.github.com/users/mitake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitake/subscriptions","organizations_url":"https://api.github.com/users/mitake/orgs","repos_url":"https://api.github.com/users/mitake/repos","events_url":"https://api.github.com/users/mitake/events{/privacy}","received_events_url":"https://api.github.com/users/mitake/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mitake/etcd","description":"A distributed consistent key-value store for shared configuration and service discovery","fork":true,"url":"https://api.github.com/repos/mitake/etcd","forks_url":"https://api.github.com/repos/mitake/etcd/forks","keys_url":"https://api.github.com/repos/mitake/etcd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mitake/etcd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mitake/etcd/teams","hooks_url":"https://api.github.com/repos/mitake/etcd/hooks","issue_events_url":"https://api.github.com/repos/mitake/etcd/issues/events{/number}","events_url":"https://api.github.com/repos/mitake/etcd/events","assignees_url":"https://api.github.com/repos/mitake/etcd/assignees{/user}","branches_url":"https://api.github.com/repos/mitake/etcd/branches{/branch}","tags_url":"https://api.github.com/repos/mitake/etcd/tags","blobs_url":"https://api.github.com/repos/mitake/etcd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mitake/etcd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mitake/etcd/git/refs{/sha}","trees_url":"https://api.github.com/repos/mitake/etcd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mitake/etcd/statuses/{sha}","languages_url":"https://api.github.com/repos/mitake/etcd/languages","stargazers_url":"https://api.github.com/repos/mitake/etcd/stargazers","contributors_url":"https://api.github.com/repos/mitake/etcd/contributors","subscribers_url":"https://api.github.com/repos/mitake/etcd/subscribers","subscription_url":"https://api.github.com/repos/mitake/etcd/subscription","commits_url":"https://api.github.com/repos/mitake/etcd/commits{/sha}","git_commits_url":"https://api.github.com/repos/mitake/etcd/git/commits{/sha}","comments_url":"https://api.github.com/repos/mitake/etcd/comments{/number}","issue_comment_url":"https://api.github.com/repos/mitake/etcd/issues/comments{/number}","contents_url":"https://api.github.com/repos/mitake/etcd/contents/{+path}","compare_url":"https://api.github.com/repos/mitake/etcd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mitake/etcd/merges","archive_url":"https://api.github.com/repos/mitake/etcd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mitake/etcd/downloads","issues_url":"https://api.github.com/repos/mitake/etcd/issues{/number}","pulls_url":"https://api.github.com/repos/mitake/etcd/pulls{/number}","milestones_url":"https://api.github.com/repos/mitake/etcd/milestones{/number}","notifications_url":"https://api.github.com/repos/mitake/etcd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mitake/etcd/labels{/name}","releases_url":"https://api.github.com/repos/mitake/etcd/releases{/id}","created_at":"2015-08-05T02:10:59Z","updated_at":"2015-08-05T02:11:01Z","pushed_at":"2015-09-13T03:30:15Z","git_url":"git://github.com/mitake/etcd.git","ssh_url":"git@github.com:mitake/etcd.git","clone_url":"https://github.com/mitake/etcd.git","svn_url":"https://github.com/mitake/etcd","homepage":"","size":18472,"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":"d4e19d1afb2df0d5ef8eaf58790edf7e1bd9a1bc","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":"A distributed consistent key-value store for shared configuration and service discovery","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}","created_at":"2013-07-06T21:57:21Z","updated_at":"2015-09-13T04:22:08Z","pushed_at":"2015-09-13T05:09:13Z","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":"","size":35969,"stargazers_count":7471,"watchers_count":7471,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1085,"mirror_url":null,"open_issues_count":108,"forks":1085,"open_issues":108,"watchers":7471,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coreos/etcd/pulls/3479"},"html":{"href":"https://github.com/coreos/etcd/pull/3479"},"issue":{"href":"https://api.github.com/repos/coreos/etcd/issues/3479"},"comments":{"href":"https://api.github.com/repos/coreos/etcd/issues/3479/comments"},"review_comments":{"href":"https://api.github.com/repos/coreos/etcd/pulls/3479/comments"},"review_comment":{"href":"https://api.github.com/repos/coreos/etcd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coreos/etcd/pulls/3479/commits"},"statuses":{"href":"https://api.github.com/repos/coreos/etcd/statuses/dad32646eb1918c4208c8ac4807cd9e0a2ebe7b7"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"yichengq","id":2976232,"avatar_url":"https://avatars.githubusercontent.com/u/2976232?v=3","gravatar_id":"","url":"https://api.github.com/users/yichengq","html_url":"https://github.com/yichengq","followers_url":"https://api.github.com/users/yichengq/followers","following_url":"https://api.github.com/users/yichengq/following{/other_user}","gists_url":"https://api.github.com/users/yichengq/gists{/gist_id}","starred_url":"https://api.github.com/users/yichengq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yichengq/subscriptions","organizations_url":"https://api.github.com/users/yichengq/orgs","repos_url":"https://api.github.com/users/yichengq/repos","events_url":"https://api.github.com/users/yichengq/events{/privacy}","received_events_url":"https://api.github.com/users/yichengq/received_events","type":"User","site_admin":false},"comments":46,"review_comments":30,"commits":3,"additions":125,"deletions":0,"changed_files":9}}