{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/presto/pulls/comments/31454637","id":31454637,"diff_hunk":"@@ -100,10 +101,18 @@ public ConnectorPartitionResult getPartitions(ConnectorTableHandle tableHandle,\n                         log.warn(\"No leader for partition %s/%s found!\", metadata.topic(), part.partitionId());\n                     }\n                     else {\n+                        // make sure the first broker is the partition leader\n+                        List<HostAddress> isrList = part.isr().stream().map(KafkaSplitManager::brokerToHostAddress).collect(toList());\n+                        HostAddress partitionLeader = HostAddress.fromParts(leader.host(), leader.port());\n+                        if (!isrList.get(0).getHostText().equals(leader.host())","path":"presto-kafka/src/main/java/com/facebook/presto/kafka/KafkaSplitManager.java","position":24,"original_position":24,"commit_id":"4575f3c4acd758b4a9e3f545b2ef677a4b9c72d9","original_commit_id":"4575f3c4acd758b4a9e3f545b2ef677a4b9c72d9","user":{"login":"hgschmie","id":39495,"avatar_url":"https://avatars.githubusercontent.com/u/39495?v=3","gravatar_id":"","url":"https://api.github.com/users/hgschmie","html_url":"https://github.com/hgschmie","followers_url":"https://api.github.com/users/hgschmie/followers","following_url":"https://api.github.com/users/hgschmie/following{/other_user}","gists_url":"https://api.github.com/users/hgschmie/gists{/gist_id}","starred_url":"https://api.github.com/users/hgschmie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hgschmie/subscriptions","organizations_url":"https://api.github.com/users/hgschmie/orgs","repos_url":"https://api.github.com/users/hgschmie/repos","events_url":"https://api.github.com/users/hgschmie/events{/privacy}","received_events_url":"https://api.github.com/users/hgschmie/received_events","type":"User","site_admin":false},"body":"my concern around all of this is that this may or may not work depending on hostname / ip address etc. Doing a string compare assumes that the `leader.host()` is the same string as what gets returned by `brokerToHostAddress()`. ","created_at":"2015-06-01T18:26:17Z","updated_at":"2015-06-01T18:26:17Z","html_url":"https://github.com/facebook/presto/pull/3000#discussion_r31454637","pull_request_url":"https://api.github.com/repos/facebook/presto/pulls/3000","_links":{"self":{"href":"https://api.github.com/repos/facebook/presto/pulls/comments/31454637"},"html":{"href":"https://github.com/facebook/presto/pull/3000#discussion_r31454637"},"pull_request":{"href":"https://api.github.com/repos/facebook/presto/pulls/3000"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/presto/pulls/3000","id":36603190,"html_url":"https://github.com/facebook/presto/pull/3000","diff_url":"https://github.com/facebook/presto/pull/3000.diff","patch_url":"https://github.com/facebook/presto/pull/3000.patch","issue_url":"https://api.github.com/repos/facebook/presto/issues/3000","number":3000,"state":"open","locked":false,"title":"Fix could not fetch data from Kafka","user":{"login":"yuananf","id":4101738,"avatar_url":"https://avatars.githubusercontent.com/u/4101738?v=3","gravatar_id":"","url":"https://api.github.com/users/yuananf","html_url":"https://github.com/yuananf","followers_url":"https://api.github.com/users/yuananf/followers","following_url":"https://api.github.com/users/yuananf/following{/other_user}","gists_url":"https://api.github.com/users/yuananf/gists{/gist_id}","starred_url":"https://api.github.com/users/yuananf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuananf/subscriptions","organizations_url":"https://api.github.com/users/yuananf/orgs","repos_url":"https://api.github.com/users/yuananf/repos","events_url":"https://api.github.com/users/yuananf/events{/privacy}","received_events_url":"https://api.github.com/users/yuananf/received_events","type":"User","site_admin":false},"body":"fix #2704 \r\n\r\nThe error is caused by split.getNodes().get(0) in KafkaRecordSet.\r\nThis IP should be partition's leader, and the error code '6' occurs when it is not partition's leader.","created_at":"2015-06-01T06:59:43Z","updated_at":"2015-06-01T18:26:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2c4934d24dae37a5e8b453802f94b802ecd34dd7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/presto/pulls/3000/commits","review_comments_url":"https://api.github.com/repos/facebook/presto/pulls/3000/comments","review_comment_url":"https://api.github.com/repos/facebook/presto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/presto/issues/3000/comments","statuses_url":"https://api.github.com/repos/facebook/presto/statuses/4575f3c4acd758b4a9e3f545b2ef677a4b9c72d9","head":{"label":"yuananf:kafka-fix","ref":"kafka-fix","sha":"4575f3c4acd758b4a9e3f545b2ef677a4b9c72d9","user":{"login":"yuananf","id":4101738,"avatar_url":"https://avatars.githubusercontent.com/u/4101738?v=3","gravatar_id":"","url":"https://api.github.com/users/yuananf","html_url":"https://github.com/yuananf","followers_url":"https://api.github.com/users/yuananf/followers","following_url":"https://api.github.com/users/yuananf/following{/other_user}","gists_url":"https://api.github.com/users/yuananf/gists{/gist_id}","starred_url":"https://api.github.com/users/yuananf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuananf/subscriptions","organizations_url":"https://api.github.com/users/yuananf/orgs","repos_url":"https://api.github.com/users/yuananf/repos","events_url":"https://api.github.com/users/yuananf/events{/privacy}","received_events_url":"https://api.github.com/users/yuananf/received_events","type":"User","site_admin":false},"repo":{"id":31348423,"name":"presto","full_name":"yuananf/presto","owner":{"login":"yuananf","id":4101738,"avatar_url":"https://avatars.githubusercontent.com/u/4101738?v=3","gravatar_id":"","url":"https://api.github.com/users/yuananf","html_url":"https://github.com/yuananf","followers_url":"https://api.github.com/users/yuananf/followers","following_url":"https://api.github.com/users/yuananf/following{/other_user}","gists_url":"https://api.github.com/users/yuananf/gists{/gist_id}","starred_url":"https://api.github.com/users/yuananf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuananf/subscriptions","organizations_url":"https://api.github.com/users/yuananf/orgs","repos_url":"https://api.github.com/users/yuananf/repos","events_url":"https://api.github.com/users/yuananf/events{/privacy}","received_events_url":"https://api.github.com/users/yuananf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yuananf/presto","description":"Distributed SQL query engine for running interactive analytic queries against big data sources.","fork":true,"url":"https://api.github.com/repos/yuananf/presto","forks_url":"https://api.github.com/repos/yuananf/presto/forks","keys_url":"https://api.github.com/repos/yuananf/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yuananf/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yuananf/presto/teams","hooks_url":"https://api.github.com/repos/yuananf/presto/hooks","issue_events_url":"https://api.github.com/repos/yuananf/presto/issues/events{/number}","events_url":"https://api.github.com/repos/yuananf/presto/events","assignees_url":"https://api.github.com/repos/yuananf/presto/assignees{/user}","branches_url":"https://api.github.com/repos/yuananf/presto/branches{/branch}","tags_url":"https://api.github.com/repos/yuananf/presto/tags","blobs_url":"https://api.github.com/repos/yuananf/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yuananf/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yuananf/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/yuananf/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yuananf/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/yuananf/presto/languages","stargazers_url":"https://api.github.com/repos/yuananf/presto/stargazers","contributors_url":"https://api.github.com/repos/yuananf/presto/contributors","subscribers_url":"https://api.github.com/repos/yuananf/presto/subscribers","subscription_url":"https://api.github.com/repos/yuananf/presto/subscription","commits_url":"https://api.github.com/repos/yuananf/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/yuananf/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/yuananf/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/yuananf/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/yuananf/presto/contents/{+path}","compare_url":"https://api.github.com/repos/yuananf/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yuananf/presto/merges","archive_url":"https://api.github.com/repos/yuananf/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yuananf/presto/downloads","issues_url":"https://api.github.com/repos/yuananf/presto/issues{/number}","pulls_url":"https://api.github.com/repos/yuananf/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/yuananf/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/yuananf/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yuananf/presto/labels{/name}","releases_url":"https://api.github.com/repos/yuananf/presto/releases{/id}","created_at":"2015-02-26T03:14:32Z","updated_at":"2015-05-07T09:40:04Z","pushed_at":"2015-06-01T06:57:03Z","git_url":"git://github.com/yuananf/presto.git","ssh_url":"git@github.com:yuananf/presto.git","clone_url":"https://github.com/yuananf/presto.git","svn_url":"https://github.com/yuananf/presto","homepage":"https://prestodb.io","size":42036,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"facebook:master","ref":"master","sha":"210c06e6ef22a8b68116691dc80a684a69ec4ab4","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":5349565,"name":"presto","full_name":"facebook/presto","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/presto","description":"Distributed SQL query engine for running interactive analytic queries against big data sources.","fork":false,"url":"https://api.github.com/repos/facebook/presto","forks_url":"https://api.github.com/repos/facebook/presto/forks","keys_url":"https://api.github.com/repos/facebook/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/presto/teams","hooks_url":"https://api.github.com/repos/facebook/presto/hooks","issue_events_url":"https://api.github.com/repos/facebook/presto/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/presto/events","assignees_url":"https://api.github.com/repos/facebook/presto/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/presto/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/presto/tags","blobs_url":"https://api.github.com/repos/facebook/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/presto/languages","stargazers_url":"https://api.github.com/repos/facebook/presto/stargazers","contributors_url":"https://api.github.com/repos/facebook/presto/contributors","subscribers_url":"https://api.github.com/repos/facebook/presto/subscribers","subscription_url":"https://api.github.com/repos/facebook/presto/subscription","commits_url":"https://api.github.com/repos/facebook/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/presto/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/presto/merges","archive_url":"https://api.github.com/repos/facebook/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/presto/downloads","issues_url":"https://api.github.com/repos/facebook/presto/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/presto/labels{/name}","releases_url":"https://api.github.com/repos/facebook/presto/releases{/id}","created_at":"2012-08-09T01:03:37Z","updated_at":"2015-06-01T13:56:58Z","pushed_at":"2015-06-01T18:20:28Z","git_url":"git://github.com/facebook/presto.git","ssh_url":"git@github.com:facebook/presto.git","clone_url":"https://github.com/facebook/presto.git","svn_url":"https://github.com/facebook/presto","homepage":"https://prestodb.io","size":92590,"stargazers_count":3466,"watchers_count":3466,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":809,"mirror_url":null,"open_issues_count":209,"forks":809,"open_issues":209,"watchers":3466,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/presto/pulls/3000"},"html":{"href":"https://github.com/facebook/presto/pull/3000"},"issue":{"href":"https://api.github.com/repos/facebook/presto/issues/3000"},"comments":{"href":"https://api.github.com/repos/facebook/presto/issues/3000/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/presto/pulls/3000/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/presto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/presto/pulls/3000/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/presto/statuses/4575f3c4acd758b4a9e3f545b2ef677a4b9c72d9"}}}}