{"action":"created","comment":{"url":"https://api.github.com/repos/amplab/tachyon/pulls/comments/43048742","id":43048742,"diff_hunk":"@@ -62,11 +62,18 @@ public LeaderSelectorClient(String zookeeperAddress, String electionPath, String\n \n     // Create a leader selector using the given path for management.\n     // All participants in a given leader selection must use the same path.\n-    // ExampleClient here is also a LeaderSelectorListener but this isn't required.\n     CuratorFramework client =\n         CuratorFrameworkFactory.newClient(mZookeeperAddress, new ExponentialBackoffRetry(\n             Constants.SECOND_MS, 3));\n     client.start();\n+\n+    // Sometimes, if the master crashes and restarts too quickly, zookeeper thinks the new client is\n+    // still an old one. Close the \"old\" client and recreate a new one.\n+    client.close();","path":"common/src/main/java/tachyon/LeaderSelectorClient.java","position":12,"original_position":12,"commit_id":"bf3c49582ee2a507254e8af789270e41357150ed","original_commit_id":"bf3c49582ee2a507254e8af789270e41357150ed","user":{"login":"calvinjia","id":2223813,"avatar_url":"https://avatars.githubusercontent.com/u/2223813?v=3","gravatar_id":"","url":"https://api.github.com/users/calvinjia","html_url":"https://github.com/calvinjia","followers_url":"https://api.github.com/users/calvinjia/followers","following_url":"https://api.github.com/users/calvinjia/following{/other_user}","gists_url":"https://api.github.com/users/calvinjia/gists{/gist_id}","starred_url":"https://api.github.com/users/calvinjia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calvinjia/subscriptions","organizations_url":"https://api.github.com/users/calvinjia/orgs","repos_url":"https://api.github.com/users/calvinjia/repos","events_url":"https://api.github.com/users/calvinjia/events{/privacy}","received_events_url":"https://api.github.com/users/calvinjia/received_events","type":"User","site_admin":false},"body":"I think the idea is to pretend the newly opened client will be interpreted as the old client (when it might not be). Then, explicitly close the client which gets us to a clean state regardless of what might have happened prior. Maybe this should be refactored into a method to make more clear?","created_at":"2015-10-26T20:34:01Z","updated_at":"2015-10-26T20:34:01Z","html_url":"https://github.com/amplab/tachyon/pull/1885#discussion_r43048742","pull_request_url":"https://api.github.com/repos/amplab/tachyon/pulls/1885","_links":{"self":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/comments/43048742"},"html":{"href":"https://github.com/amplab/tachyon/pull/1885#discussion_r43048742"},"pull_request":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/1885"}}},"pull_request":{"url":"https://api.github.com/repos/amplab/tachyon/pulls/1885","id":48702330,"html_url":"https://github.com/amplab/tachyon/pull/1885","diff_url":"https://github.com/amplab/tachyon/pull/1885.diff","patch_url":"https://github.com/amplab/tachyon/pull/1885.patch","issue_url":"https://api.github.com/repos/amplab/tachyon/issues/1885","number":1885,"state":"open","locked":false,"title":"[SMALLFIX] Fix master fault tolerant restart behavior","user":{"login":"gpang","id":429032,"avatar_url":"https://avatars.githubusercontent.com/u/429032?v=3","gravatar_id":"","url":"https://api.github.com/users/gpang","html_url":"https://github.com/gpang","followers_url":"https://api.github.com/users/gpang/followers","following_url":"https://api.github.com/users/gpang/following{/other_user}","gists_url":"https://api.github.com/users/gpang/gists{/gist_id}","starred_url":"https://api.github.com/users/gpang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpang/subscriptions","organizations_url":"https://api.github.com/users/gpang/orgs","repos_url":"https://api.github.com/users/gpang/repos","events_url":"https://api.github.com/users/gpang/events{/privacy}","received_events_url":"https://api.github.com/users/gpang/received_events","type":"User","site_admin":false},"body":"When a master restarts very quickly and creates a connection to zookeeper, zk still thinks it is the old client, so it thinks the master is the same, instead of a newly started master. This prevents the new master from taking leadership, and therefore, prevents any of the masters to be serving as the leader.","created_at":"2015-10-26T05:15:11Z","updated_at":"2015-10-26T20:34:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3b47b5419c132349a08ddb4f4a1ac8c1ff0372e4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/amplab/tachyon/pulls/1885/commits","review_comments_url":"https://api.github.com/repos/amplab/tachyon/pulls/1885/comments","review_comment_url":"https://api.github.com/repos/amplab/tachyon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amplab/tachyon/issues/1885/comments","statuses_url":"https://api.github.com/repos/amplab/tachyon/statuses/bf3c49582ee2a507254e8af789270e41357150ed","head":{"label":"gpang:fix_zk_master","ref":"fix_zk_master","sha":"bf3c49582ee2a507254e8af789270e41357150ed","user":{"login":"gpang","id":429032,"avatar_url":"https://avatars.githubusercontent.com/u/429032?v=3","gravatar_id":"","url":"https://api.github.com/users/gpang","html_url":"https://github.com/gpang","followers_url":"https://api.github.com/users/gpang/followers","following_url":"https://api.github.com/users/gpang/following{/other_user}","gists_url":"https://api.github.com/users/gpang/gists{/gist_id}","starred_url":"https://api.github.com/users/gpang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpang/subscriptions","organizations_url":"https://api.github.com/users/gpang/orgs","repos_url":"https://api.github.com/users/gpang/repos","events_url":"https://api.github.com/users/gpang/events{/privacy}","received_events_url":"https://api.github.com/users/gpang/received_events","type":"User","site_admin":false},"repo":{"id":32651495,"name":"tachyon","full_name":"gpang/tachyon","owner":{"login":"gpang","id":429032,"avatar_url":"https://avatars.githubusercontent.com/u/429032?v=3","gravatar_id":"","url":"https://api.github.com/users/gpang","html_url":"https://github.com/gpang","followers_url":"https://api.github.com/users/gpang/followers","following_url":"https://api.github.com/users/gpang/following{/other_user}","gists_url":"https://api.github.com/users/gpang/gists{/gist_id}","starred_url":"https://api.github.com/users/gpang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpang/subscriptions","organizations_url":"https://api.github.com/users/gpang/orgs","repos_url":"https://api.github.com/users/gpang/repos","events_url":"https://api.github.com/users/gpang/events{/privacy}","received_events_url":"https://api.github.com/users/gpang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gpang/tachyon","description":" A Reliable Memory Centric Distributed Storage System","fork":true,"url":"https://api.github.com/repos/gpang/tachyon","forks_url":"https://api.github.com/repos/gpang/tachyon/forks","keys_url":"https://api.github.com/repos/gpang/tachyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gpang/tachyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gpang/tachyon/teams","hooks_url":"https://api.github.com/repos/gpang/tachyon/hooks","issue_events_url":"https://api.github.com/repos/gpang/tachyon/issues/events{/number}","events_url":"https://api.github.com/repos/gpang/tachyon/events","assignees_url":"https://api.github.com/repos/gpang/tachyon/assignees{/user}","branches_url":"https://api.github.com/repos/gpang/tachyon/branches{/branch}","tags_url":"https://api.github.com/repos/gpang/tachyon/tags","blobs_url":"https://api.github.com/repos/gpang/tachyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gpang/tachyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gpang/tachyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/gpang/tachyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gpang/tachyon/statuses/{sha}","languages_url":"https://api.github.com/repos/gpang/tachyon/languages","stargazers_url":"https://api.github.com/repos/gpang/tachyon/stargazers","contributors_url":"https://api.github.com/repos/gpang/tachyon/contributors","subscribers_url":"https://api.github.com/repos/gpang/tachyon/subscribers","subscription_url":"https://api.github.com/repos/gpang/tachyon/subscription","commits_url":"https://api.github.com/repos/gpang/tachyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/gpang/tachyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/gpang/tachyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/gpang/tachyon/issues/comments{/number}","contents_url":"https://api.github.com/repos/gpang/tachyon/contents/{+path}","compare_url":"https://api.github.com/repos/gpang/tachyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gpang/tachyon/merges","archive_url":"https://api.github.com/repos/gpang/tachyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gpang/tachyon/downloads","issues_url":"https://api.github.com/repos/gpang/tachyon/issues{/number}","pulls_url":"https://api.github.com/repos/gpang/tachyon/pulls{/number}","milestones_url":"https://api.github.com/repos/gpang/tachyon/milestones{/number}","notifications_url":"https://api.github.com/repos/gpang/tachyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gpang/tachyon/labels{/name}","releases_url":"https://api.github.com/repos/gpang/tachyon/releases{/id}","created_at":"2015-03-21T21:51:11Z","updated_at":"2015-05-01T21:22:09Z","pushed_at":"2015-10-26T05:08:40Z","git_url":"git://github.com/gpang/tachyon.git","ssh_url":"git@github.com:gpang/tachyon.git","clone_url":"https://github.com/gpang/tachyon.git","svn_url":"https://github.com/gpang/tachyon","homepage":"http://tachyon-project.org","size":27345,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"amplab:branch-0.8","ref":"branch-0.8","sha":"81e498587cc9fd8f4c8755e70baf292055a3a00b","user":{"login":"amplab","id":1438454,"avatar_url":"https://avatars.githubusercontent.com/u/1438454?v=3","gravatar_id":"","url":"https://api.github.com/users/amplab","html_url":"https://github.com/amplab","followers_url":"https://api.github.com/users/amplab/followers","following_url":"https://api.github.com/users/amplab/following{/other_user}","gists_url":"https://api.github.com/users/amplab/gists{/gist_id}","starred_url":"https://api.github.com/users/amplab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplab/subscriptions","organizations_url":"https://api.github.com/users/amplab/orgs","repos_url":"https://api.github.com/users/amplab/repos","events_url":"https://api.github.com/users/amplab/events{/privacy}","received_events_url":"https://api.github.com/users/amplab/received_events","type":"Organization","site_admin":false},"repo":{"id":7276954,"name":"tachyon","full_name":"amplab/tachyon","owner":{"login":"amplab","id":1438454,"avatar_url":"https://avatars.githubusercontent.com/u/1438454?v=3","gravatar_id":"","url":"https://api.github.com/users/amplab","html_url":"https://github.com/amplab","followers_url":"https://api.github.com/users/amplab/followers","following_url":"https://api.github.com/users/amplab/following{/other_user}","gists_url":"https://api.github.com/users/amplab/gists{/gist_id}","starred_url":"https://api.github.com/users/amplab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplab/subscriptions","organizations_url":"https://api.github.com/users/amplab/orgs","repos_url":"https://api.github.com/users/amplab/repos","events_url":"https://api.github.com/users/amplab/events{/privacy}","received_events_url":"https://api.github.com/users/amplab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/amplab/tachyon","description":"Memory Centric Reliable Distributed Storage","fork":false,"url":"https://api.github.com/repos/amplab/tachyon","forks_url":"https://api.github.com/repos/amplab/tachyon/forks","keys_url":"https://api.github.com/repos/amplab/tachyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amplab/tachyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amplab/tachyon/teams","hooks_url":"https://api.github.com/repos/amplab/tachyon/hooks","issue_events_url":"https://api.github.com/repos/amplab/tachyon/issues/events{/number}","events_url":"https://api.github.com/repos/amplab/tachyon/events","assignees_url":"https://api.github.com/repos/amplab/tachyon/assignees{/user}","branches_url":"https://api.github.com/repos/amplab/tachyon/branches{/branch}","tags_url":"https://api.github.com/repos/amplab/tachyon/tags","blobs_url":"https://api.github.com/repos/amplab/tachyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amplab/tachyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amplab/tachyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/amplab/tachyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amplab/tachyon/statuses/{sha}","languages_url":"https://api.github.com/repos/amplab/tachyon/languages","stargazers_url":"https://api.github.com/repos/amplab/tachyon/stargazers","contributors_url":"https://api.github.com/repos/amplab/tachyon/contributors","subscribers_url":"https://api.github.com/repos/amplab/tachyon/subscribers","subscription_url":"https://api.github.com/repos/amplab/tachyon/subscription","commits_url":"https://api.github.com/repos/amplab/tachyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/amplab/tachyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/amplab/tachyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/amplab/tachyon/issues/comments{/number}","contents_url":"https://api.github.com/repos/amplab/tachyon/contents/{+path}","compare_url":"https://api.github.com/repos/amplab/tachyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amplab/tachyon/merges","archive_url":"https://api.github.com/repos/amplab/tachyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amplab/tachyon/downloads","issues_url":"https://api.github.com/repos/amplab/tachyon/issues{/number}","pulls_url":"https://api.github.com/repos/amplab/tachyon/pulls{/number}","milestones_url":"https://api.github.com/repos/amplab/tachyon/milestones{/number}","notifications_url":"https://api.github.com/repos/amplab/tachyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amplab/tachyon/labels{/name}","releases_url":"https://api.github.com/repos/amplab/tachyon/releases{/id}","created_at":"2012-12-21T17:43:46Z","updated_at":"2015-10-26T11:24:35Z","pushed_at":"2015-10-26T20:31:22Z","git_url":"git://github.com/amplab/tachyon.git","ssh_url":"git@github.com:amplab/tachyon.git","clone_url":"https://github.com/amplab/tachyon.git","svn_url":"https://github.com/amplab/tachyon","homepage":"http://tachyon-project.org","size":59299,"stargazers_count":1666,"watchers_count":1666,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":662,"mirror_url":null,"open_issues_count":31,"forks":662,"open_issues":31,"watchers":1666,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/1885"},"html":{"href":"https://github.com/amplab/tachyon/pull/1885"},"issue":{"href":"https://api.github.com/repos/amplab/tachyon/issues/1885"},"comments":{"href":"https://api.github.com/repos/amplab/tachyon/issues/1885/comments"},"review_comments":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/1885/comments"},"review_comment":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/1885/commits"},"statuses":{"href":"https://api.github.com/repos/amplab/tachyon/statuses/bf3c49582ee2a507254e8af789270e41357150ed"}}}}