{"action":"created","comment":{"url":"https://api.github.com/repos/prestodb/presto/pulls/comments/60377330","id":60377330,"diff_hunk":"@@ -100,7 +99,8 @@ public ConnectorSplitSource getSplits(ConnectorTransactionHandle transaction, Co\n                 SimpleConsumer leaderConsumer = consumerManager.getConsumer(partitionLeader);\n                 // Kafka contains a reverse list of \"end - start\" pairs for the splits\n \n-                List<HostAddress> partitionNodes = ImmutableList.copyOf(Lists.transform(part.isr(), KafkaSplitManager::brokerToHostAddress));\n+                // Always talk to partition leader\n+                List<HostAddress> partitionNodes = ImmutableList.of(partitionLeader);","path":"presto-kafka/src/main/java/com/facebook/presto/kafka/KafkaSplitManager.java","position":14,"original_position":14,"commit_id":"7d67a1c225d434a8e259248ba209c0d19bbb86a7","original_commit_id":"7d67a1c225d434a8e259248ba209c0d19bbb86a7","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":"A list of nodes here can be eliminated, but maybe it's better to keep the list of nodes in ```KafkaSplit```, because ```KafkaSplit``` should override function ```getAddresses()``` for \r\nscheduling, and this returns a list of HostAddress.\r\n```split.getNodes().get(0)```can be simplified as ```split.getLeader()```.\r\n\r\nWhat do you suggest? Should we build a list everytime we call ```getAddresses()```.","created_at":"2016-04-20T09:33:15Z","updated_at":"2016-04-20T09:33:15Z","html_url":"https://github.com/prestodb/presto/pull/3000#discussion_r60377330","pull_request_url":"https://api.github.com/repos/prestodb/presto/pulls/3000","_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments/60377330"},"html":{"href":"https://github.com/prestodb/presto/pull/3000#discussion_r60377330"},"pull_request":{"href":"https://api.github.com/repos/prestodb/presto/pulls/3000"}}},"pull_request":{"url":"https://api.github.com/repos/prestodb/presto/pulls/3000","id":36603190,"html_url":"https://github.com/prestodb/presto/pull/3000","diff_url":"https://github.com/prestodb/presto/pull/3000.diff","patch_url":"https://github.com/prestodb/presto/pull/3000.patch","issue_url":"https://api.github.com/repos/prestodb/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":"2016-04-20T09:33:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ee3e09c9b9f4ae1bde3ebd7355568e479b376540","assignee":{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/prestodb/presto/pulls/3000/commits","review_comments_url":"https://api.github.com/repos/prestodb/presto/pulls/3000/comments","review_comment_url":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prestodb/presto/issues/3000/comments","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/7d67a1c225d434a8e259248ba209c0d19bbb86a7","head":{"label":"yuananf:kafka-fix","ref":"kafka-fix","sha":"7d67a1c225d434a8e259248ba209c0d19bbb86a7","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}","deployments_url":"https://api.github.com/repos/yuananf/presto/deployments","created_at":"2015-02-26T03:14:32Z","updated_at":"2016-01-12T07:35:44Z","pushed_at":"2016-04-20T07:53:20Z","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":52662,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"prestodb:master","ref":"master","sha":"549aee781dec587b62d4fd5255cf161be16445b7","user":{"login":"prestodb","id":6882181,"avatar_url":"https://avatars.githubusercontent.com/u/6882181?v=3","gravatar_id":"","url":"https://api.github.com/users/prestodb","html_url":"https://github.com/prestodb","followers_url":"https://api.github.com/users/prestodb/followers","following_url":"https://api.github.com/users/prestodb/following{/other_user}","gists_url":"https://api.github.com/users/prestodb/gists{/gist_id}","starred_url":"https://api.github.com/users/prestodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestodb/subscriptions","organizations_url":"https://api.github.com/users/prestodb/orgs","repos_url":"https://api.github.com/users/prestodb/repos","events_url":"https://api.github.com/users/prestodb/events{/privacy}","received_events_url":"https://api.github.com/users/prestodb/received_events","type":"Organization","site_admin":false},"repo":{"id":5349565,"name":"presto","full_name":"prestodb/presto","owner":{"login":"prestodb","id":6882181,"avatar_url":"https://avatars.githubusercontent.com/u/6882181?v=3","gravatar_id":"","url":"https://api.github.com/users/prestodb","html_url":"https://github.com/prestodb","followers_url":"https://api.github.com/users/prestodb/followers","following_url":"https://api.github.com/users/prestodb/following{/other_user}","gists_url":"https://api.github.com/users/prestodb/gists{/gist_id}","starred_url":"https://api.github.com/users/prestodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestodb/subscriptions","organizations_url":"https://api.github.com/users/prestodb/orgs","repos_url":"https://api.github.com/users/prestodb/repos","events_url":"https://api.github.com/users/prestodb/events{/privacy}","received_events_url":"https://api.github.com/users/prestodb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prestodb/presto","description":"Distributed SQL query engine for big data","fork":false,"url":"https://api.github.com/repos/prestodb/presto","forks_url":"https://api.github.com/repos/prestodb/presto/forks","keys_url":"https://api.github.com/repos/prestodb/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prestodb/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prestodb/presto/teams","hooks_url":"https://api.github.com/repos/prestodb/presto/hooks","issue_events_url":"https://api.github.com/repos/prestodb/presto/issues/events{/number}","events_url":"https://api.github.com/repos/prestodb/presto/events","assignees_url":"https://api.github.com/repos/prestodb/presto/assignees{/user}","branches_url":"https://api.github.com/repos/prestodb/presto/branches{/branch}","tags_url":"https://api.github.com/repos/prestodb/presto/tags","blobs_url":"https://api.github.com/repos/prestodb/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prestodb/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prestodb/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/prestodb/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/prestodb/presto/languages","stargazers_url":"https://api.github.com/repos/prestodb/presto/stargazers","contributors_url":"https://api.github.com/repos/prestodb/presto/contributors","subscribers_url":"https://api.github.com/repos/prestodb/presto/subscribers","subscription_url":"https://api.github.com/repos/prestodb/presto/subscription","commits_url":"https://api.github.com/repos/prestodb/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/prestodb/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/prestodb/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/prestodb/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/prestodb/presto/contents/{+path}","compare_url":"https://api.github.com/repos/prestodb/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prestodb/presto/merges","archive_url":"https://api.github.com/repos/prestodb/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prestodb/presto/downloads","issues_url":"https://api.github.com/repos/prestodb/presto/issues{/number}","pulls_url":"https://api.github.com/repos/prestodb/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/prestodb/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/prestodb/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prestodb/presto/labels{/name}","releases_url":"https://api.github.com/repos/prestodb/presto/releases{/id}","deployments_url":"https://api.github.com/repos/prestodb/presto/deployments","created_at":"2012-08-09T01:03:37Z","updated_at":"2016-04-20T09:10:09Z","pushed_at":"2016-04-20T08:26:21Z","git_url":"git://github.com/prestodb/presto.git","ssh_url":"git@github.com:prestodb/presto.git","clone_url":"https://github.com/prestodb/presto.git","svn_url":"https://github.com/prestodb/presto","homepage":"https://prestodb.io","size":147392,"stargazers_count":4677,"watchers_count":4677,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1354,"mirror_url":null,"open_issues_count":583,"forks":1354,"open_issues":583,"watchers":4677,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/3000"},"html":{"href":"https://github.com/prestodb/presto/pull/3000"},"issue":{"href":"https://api.github.com/repos/prestodb/presto/issues/3000"},"comments":{"href":"https://api.github.com/repos/prestodb/presto/issues/3000/comments"},"review_comments":{"href":"https://api.github.com/repos/prestodb/presto/pulls/3000/comments"},"review_comment":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prestodb/presto/pulls/3000/commits"},"statuses":{"href":"https://api.github.com/repos/prestodb/presto/statuses/7d67a1c225d434a8e259248ba209c0d19bbb86a7"}}}}