{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/174658534","pull_request_review_id":104053681,"id":174658534,"diff_hunk":"@@ -47,19 +47,19 @@ import java.lang.{Long => JLong}\n import java.util.regex.Pattern\n \n object LogAppendInfo {\n-  val UnknownLogAppendInfo = LogAppendInfo(-1, -1, RecordBatch.NO_TIMESTAMP, -1L, RecordBatch.NO_TIMESTAMP, -1L,\n+  val UnknownLogAppendInfo = LogAppendInfo(Some(-1L), -1, RecordBatch.NO_TIMESTAMP, -1L, RecordBatch.NO_TIMESTAMP, -1L,","path":"core/src/main/scala/kafka/log/Log.scala","position":5,"original_position":5,"commit_id":"d3743b3039c976e678bde34a587bf8a43ac500c7","original_commit_id":"d3743b3039c976e678bde34a587bf8a43ac500c7","user":{"login":"hachikuji","id":12502538,"avatar_url":"https://avatars3.githubusercontent.com/u/12502538?v=4","gravatar_id":"","url":"https://api.github.com/users/hachikuji","html_url":"https://github.com/hachikuji","followers_url":"https://api.github.com/users/hachikuji/followers","following_url":"https://api.github.com/users/hachikuji/following{/other_user}","gists_url":"https://api.github.com/users/hachikuji/gists{/gist_id}","starred_url":"https://api.github.com/users/hachikuji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hachikuji/subscriptions","organizations_url":"https://api.github.com/users/hachikuji/orgs","repos_url":"https://api.github.com/users/hachikuji/repos","events_url":"https://api.github.com/users/hachikuji/events{/privacy}","received_events_url":"https://api.github.com/users/hachikuji/received_events","type":"User","site_admin":false},"body":"Could we use `None` instead so that we can always guarantee that the first offset, if present, is positive? As far as I can tell, outside of test cases, we just have a couple calls to `firstOffset.get` inside `ReplicaManager` that we would need to replace with `getOrElse(-1)`. \r\n\r\nI would also like to remove this `UnknownLogAppendInfo` since this pattern has proven error-prone, but we can leave that for future work.","created_at":"2018-03-15T01:51:39Z","updated_at":"2018-03-15T01:56:34Z","html_url":"https://github.com/apache/kafka/pull/4660#discussion_r174658534","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/4660","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/174658534"},"html":{"href":"https://github.com/apache/kafka/pull/4660#discussion_r174658534"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/4660"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/4660","id":173608101,"html_url":"https://github.com/apache/kafka/pull/4660","diff_url":"https://github.com/apache/kafka/pull/4660.diff","patch_url":"https://github.com/apache/kafka/pull/4660.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/4660","number":4660,"state":"open","locked":false,"title":"KAFKA-6530: Use actual first offset of message set when rolling log segment","user":{"login":"dhruvilshah3","id":14958864,"avatar_url":"https://avatars3.githubusercontent.com/u/14958864?v=4","gravatar_id":"","url":"https://api.github.com/users/dhruvilshah3","html_url":"https://github.com/dhruvilshah3","followers_url":"https://api.github.com/users/dhruvilshah3/followers","following_url":"https://api.github.com/users/dhruvilshah3/following{/other_user}","gists_url":"https://api.github.com/users/dhruvilshah3/gists{/gist_id}","starred_url":"https://api.github.com/users/dhruvilshah3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhruvilshah3/subscriptions","organizations_url":"https://api.github.com/users/dhruvilshah3/orgs","repos_url":"https://api.github.com/users/dhruvilshah3/repos","events_url":"https://api.github.com/users/dhruvilshah3/events{/privacy}","received_events_url":"https://api.github.com/users/dhruvilshah3/received_events","type":"User","site_admin":false},"body":"Use the exact first offset of message set when rolling log segment. This is possible to do for message format V2 and beyond without any performance penalty, because we have the first offset stored in the header. This augments the fix made in KAFKA-4451 to avoid using the heuristic for V2 and beyond messages.\r\n\r\nAdded unit tests to simulate cases where segment needs to roll because of overflow in index offsets. Verified that the new segment created in these cases uses the first offset, instead of the heuristic in use previously.\r\n\r\n### Committer Checklist (excluded from commit message)\r\n- [ ] Verify design and implementation \r\n- [ ] Verify test coverage and CI build status\r\n- [ ] Verify documentation (including upgrade notes)\r\n","created_at":"2018-03-07T23:55:35Z","updated_at":"2018-03-15T01:56:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa4d98eb8a834d82823c591fc9509de14f65f75a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/4660/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/4660/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/4660/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/d3743b3039c976e678bde34a587bf8a43ac500c7","head":{"label":"dhruvilshah3:KAFKA-6530","ref":"KAFKA-6530","sha":"d3743b3039c976e678bde34a587bf8a43ac500c7","user":{"login":"dhruvilshah3","id":14958864,"avatar_url":"https://avatars3.githubusercontent.com/u/14958864?v=4","gravatar_id":"","url":"https://api.github.com/users/dhruvilshah3","html_url":"https://github.com/dhruvilshah3","followers_url":"https://api.github.com/users/dhruvilshah3/followers","following_url":"https://api.github.com/users/dhruvilshah3/following{/other_user}","gists_url":"https://api.github.com/users/dhruvilshah3/gists{/gist_id}","starred_url":"https://api.github.com/users/dhruvilshah3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhruvilshah3/subscriptions","organizations_url":"https://api.github.com/users/dhruvilshah3/orgs","repos_url":"https://api.github.com/users/dhruvilshah3/repos","events_url":"https://api.github.com/users/dhruvilshah3/events{/privacy}","received_events_url":"https://api.github.com/users/dhruvilshah3/received_events","type":"User","site_admin":false},"repo":{"id":121815241,"name":"kafka","full_name":"dhruvilshah3/kafka","owner":{"login":"dhruvilshah3","id":14958864,"avatar_url":"https://avatars3.githubusercontent.com/u/14958864?v=4","gravatar_id":"","url":"https://api.github.com/users/dhruvilshah3","html_url":"https://github.com/dhruvilshah3","followers_url":"https://api.github.com/users/dhruvilshah3/followers","following_url":"https://api.github.com/users/dhruvilshah3/following{/other_user}","gists_url":"https://api.github.com/users/dhruvilshah3/gists{/gist_id}","starred_url":"https://api.github.com/users/dhruvilshah3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhruvilshah3/subscriptions","organizations_url":"https://api.github.com/users/dhruvilshah3/orgs","repos_url":"https://api.github.com/users/dhruvilshah3/repos","events_url":"https://api.github.com/users/dhruvilshah3/events{/privacy}","received_events_url":"https://api.github.com/users/dhruvilshah3/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dhruvilshah3/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/dhruvilshah3/kafka","forks_url":"https://api.github.com/repos/dhruvilshah3/kafka/forks","keys_url":"https://api.github.com/repos/dhruvilshah3/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dhruvilshah3/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dhruvilshah3/kafka/teams","hooks_url":"https://api.github.com/repos/dhruvilshah3/kafka/hooks","issue_events_url":"https://api.github.com/repos/dhruvilshah3/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/dhruvilshah3/kafka/events","assignees_url":"https://api.github.com/repos/dhruvilshah3/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/dhruvilshah3/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/dhruvilshah3/kafka/tags","blobs_url":"https://api.github.com/repos/dhruvilshah3/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dhruvilshah3/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dhruvilshah3/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/dhruvilshah3/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dhruvilshah3/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/dhruvilshah3/kafka/languages","stargazers_url":"https://api.github.com/repos/dhruvilshah3/kafka/stargazers","contributors_url":"https://api.github.com/repos/dhruvilshah3/kafka/contributors","subscribers_url":"https://api.github.com/repos/dhruvilshah3/kafka/subscribers","subscription_url":"https://api.github.com/repos/dhruvilshah3/kafka/subscription","commits_url":"https://api.github.com/repos/dhruvilshah3/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/dhruvilshah3/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/dhruvilshah3/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/dhruvilshah3/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/dhruvilshah3/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/dhruvilshah3/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dhruvilshah3/kafka/merges","archive_url":"https://api.github.com/repos/dhruvilshah3/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dhruvilshah3/kafka/downloads","issues_url":"https://api.github.com/repos/dhruvilshah3/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/dhruvilshah3/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/dhruvilshah3/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/dhruvilshah3/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dhruvilshah3/kafka/labels{/name}","releases_url":"https://api.github.com/repos/dhruvilshah3/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/dhruvilshah3/kafka/deployments","created_at":"2018-02-17T00:27:42Z","updated_at":"2018-03-13T17:42:34Z","pushed_at":"2018-03-14T21:50:11Z","git_url":"git://github.com/dhruvilshah3/kafka.git","ssh_url":"git@github.com:dhruvilshah3/kafka.git","clone_url":"https://github.com/dhruvilshah3/kafka.git","svn_url":"https://github.com/dhruvilshah3/kafka","homepage":null,"size":63620,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"trunk"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"cf092aeecc473b70d81c00b604e29de8c9f6d84b","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":2211243,"name":"kafka","full_name":"apache/kafka","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/kafka","description":"Mirror of Apache Kafka","fork":false,"url":"https://api.github.com/repos/apache/kafka","forks_url":"https://api.github.com/repos/apache/kafka/forks","keys_url":"https://api.github.com/repos/apache/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/kafka/teams","hooks_url":"https://api.github.com/repos/apache/kafka/hooks","issue_events_url":"https://api.github.com/repos/apache/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/apache/kafka/events","assignees_url":"https://api.github.com/repos/apache/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/apache/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/apache/kafka/tags","blobs_url":"https://api.github.com/repos/apache/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/kafka/languages","stargazers_url":"https://api.github.com/repos/apache/kafka/stargazers","contributors_url":"https://api.github.com/repos/apache/kafka/contributors","subscribers_url":"https://api.github.com/repos/apache/kafka/subscribers","subscription_url":"https://api.github.com/repos/apache/kafka/subscription","commits_url":"https://api.github.com/repos/apache/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/apache/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/kafka/merges","archive_url":"https://api.github.com/repos/apache/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/kafka/downloads","issues_url":"https://api.github.com/repos/apache/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/apache/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/kafka/labels{/name}","releases_url":"https://api.github.com/repos/apache/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/apache/kafka/deployments","created_at":"2011-08-15T18:06:16Z","updated_at":"2018-03-15T01:33:51Z","pushed_at":"2018-03-15T01:13:50Z","git_url":"git://github.com/apache/kafka.git","ssh_url":"git@github.com:apache/kafka.git","clone_url":"https://github.com/apache/kafka.git","svn_url":"https://github.com/apache/kafka","homepage":null,"size":63715,"stargazers_count":7668,"watchers_count":7668,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4563,"mirror_url":null,"archived":false,"open_issues_count":425,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":4563,"open_issues":425,"watchers":7668,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/4660"},"html":{"href":"https://github.com/apache/kafka/pull/4660"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/4660"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/4660/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/4660/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/4660/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/d3743b3039c976e678bde34a587bf8a43ac500c7"}},"author_association":"NONE"}}
{"actor":{"display_login":"hachikuji"}}