{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/193888002","pull_request_review_id":126955319,"id":193888002,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Mzg4ODAwMg==","diff_hunk":"@@ -331,33 +331,29 @@ class KafkaApis(val requestChannel: RequestChannel,\n       } else {\n         // for version 1 and beyond store offsets in offset manager\n \n-        // compute the retention time based on the request version:\n-        // if it is v1 or not specified by user, we can use the default retention\n-        val offsetRetention =\n-          if (header.apiVersion <= 1 ||\n-            offsetCommitRequest.retentionTime == OffsetCommitRequest.DEFAULT_RETENTION_TIME)\n-            groupCoordinator.offsetConfig.offsetsRetentionMs\n-          else\n-            offsetCommitRequest.retentionTime\n-\n         // commit timestamp is always set to now.\n         // \"default\" expiration timestamp is now + retention (and retention may be overridden if v2)\n         // expire timestamp is computed differently for v1 and v2.\n-        //   - If v1 and no explicit commit timestamp is provided we use default expiration timestamp.\n+        //   - If v1 and no explicit commit timestamp is provided we treat it the same as v5.\n         //   - If v1 and explicit commit timestamp is provided we calculate retention from that explicit commit timestamp\n-        //   - If v2 we use the default expiration timestamp\n+        //   - If v2/v3/v4 (no explicit commit timestamp) we treat it the same as v5.\n+        //   - For v5 and beyond there is no per partition expiration timestamp, so this field is no longer in effect\n         val currentTimestamp = time.milliseconds\n-        val defaultExpireTimestamp = offsetRetention + currentTimestamp\n         val partitionData = authorizedTopicRequestInfo.mapValues { partitionData =>\n           val metadata = if (partitionData.metadata == null) OffsetMetadata.NoMetadata else partitionData.metadata\n           new OffsetAndMetadata(\n             offsetMetadata = OffsetMetadata(partitionData.offset, metadata),\n-            commitTimestamp = currentTimestamp,\n-            expireTimestamp = {\n-              if (partitionData.timestamp == OffsetCommitRequest.DEFAULT_TIMESTAMP)\n-                defaultExpireTimestamp\n-              else\n-                offsetRetention + partitionData.timestamp\n+            commitTimestamp = partitionData.timestamp match {\n+              case OffsetCommitRequest.DEFAULT_TIMESTAMP => currentTimestamp\n+              case customTimestamp => customTimestamp\n+            },\n+            expireTimestamp = offsetCommitRequest.retentionTime match {\n+              case OffsetCommitRequest.DEFAULT_RETENTION_TIME => None\n+              case retentionTime =>\n+                partitionData.timestamp match {","path":"core/src/main/scala/kafka/server/KafkaApis.scala","position":41,"original_position":41,"commit_id":"a7450798111b560a4ca2d68444a34c899998ea7c","original_commit_id":"a7450798111b560a4ca2d68444a34c899998ea7c","user":{"login":"hachikuji","id":12502538,"node_id":"MDQ6VXNlcjEyNTAyNTM4","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":"My thought was that we could just ignore the commit timestamp and treat that as an instance of the new semantics. This simplifies the code and is probably what users would actually want. Since only the commit timestamp is provided for these old versions, there wouldn't be any client guarantees on retention anyway.","created_at":"2018-06-07T21:01:20Z","updated_at":"2018-06-07T21:01:20Z","html_url":"https://github.com/apache/kafka/pull/4896#discussion_r193888002","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/4896","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/193888002"},"html":{"href":"https://github.com/apache/kafka/pull/4896#discussion_r193888002"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/4896"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/4896","id":182691108,"node_id":"MDExOlB1bGxSZXF1ZXN0MTgyNjkxMTA4","html_url":"https://github.com/apache/kafka/pull/4896","diff_url":"https://github.com/apache/kafka/pull/4896.diff","patch_url":"https://github.com/apache/kafka/pull/4896.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/4896","number":4896,"state":"open","locked":false,"title":"KAFKA-4682: Revise expiration semantics of consumer group offsets (KIP-211 - Part 1)","user":{"login":"vahidhashemian","id":13593506,"node_id":"MDQ6VXNlcjEzNTkzNTA2","avatar_url":"https://avatars1.githubusercontent.com/u/13593506?v=4","gravatar_id":"","url":"https://api.github.com/users/vahidhashemian","html_url":"https://github.com/vahidhashemian","followers_url":"https://api.github.com/users/vahidhashemian/followers","following_url":"https://api.github.com/users/vahidhashemian/following{/other_user}","gists_url":"https://api.github.com/users/vahidhashemian/gists{/gist_id}","starred_url":"https://api.github.com/users/vahidhashemian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vahidhashemian/subscriptions","organizations_url":"https://api.github.com/users/vahidhashemian/orgs","repos_url":"https://api.github.com/users/vahidhashemian/repos","events_url":"https://api.github.com/users/vahidhashemian/events{/privacy}","received_events_url":"https://api.github.com/users/vahidhashemian/received_events","type":"User","site_admin":false},"body":"The implementation of [expiration semantics for unsubscribed topics](https://cwiki.apache.org/confluence/display/KAFKA/KIP-211%3A+Revise+Expiration+Semantics+of+Consumer+Group+Offsets#KIP-211:ReviseExpirationSemanticsofConsumerGroupOffsets-UnsubscribingfromaTopic) will be done in a separate PR.\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-04-19T07:43:01Z","updated_at":"2018-06-07T21:01:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8306cc64c90bed315c268d16f980ebe56b3832c","assignee":{"login":"hachikuji","id":12502538,"node_id":"MDQ6VXNlcjEyNTAyNTM4","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},"assignees":[{"login":"hachikuji","id":12502538,"node_id":"MDQ6VXNlcjEyNTAyNTM4","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}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/4896/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/4896/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/4896/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/a7450798111b560a4ca2d68444a34c899998ea7c","head":{"label":"vahidhashemian:KAFKA-4682","ref":"KAFKA-4682","sha":"a7450798111b560a4ca2d68444a34c899998ea7c","user":{"login":"vahidhashemian","id":13593506,"node_id":"MDQ6VXNlcjEzNTkzNTA2","avatar_url":"https://avatars1.githubusercontent.com/u/13593506?v=4","gravatar_id":"","url":"https://api.github.com/users/vahidhashemian","html_url":"https://github.com/vahidhashemian","followers_url":"https://api.github.com/users/vahidhashemian/followers","following_url":"https://api.github.com/users/vahidhashemian/following{/other_user}","gists_url":"https://api.github.com/users/vahidhashemian/gists{/gist_id}","starred_url":"https://api.github.com/users/vahidhashemian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vahidhashemian/subscriptions","organizations_url":"https://api.github.com/users/vahidhashemian/orgs","repos_url":"https://api.github.com/users/vahidhashemian/repos","events_url":"https://api.github.com/users/vahidhashemian/events{/privacy}","received_events_url":"https://api.github.com/users/vahidhashemian/received_events","type":"User","site_admin":false},"repo":{"id":47428717,"node_id":"MDEwOlJlcG9zaXRvcnk0NzQyODcxNw==","name":"kafka","full_name":"vahidhashemian/kafka","owner":{"login":"vahidhashemian","id":13593506,"node_id":"MDQ6VXNlcjEzNTkzNTA2","avatar_url":"https://avatars1.githubusercontent.com/u/13593506?v=4","gravatar_id":"","url":"https://api.github.com/users/vahidhashemian","html_url":"https://github.com/vahidhashemian","followers_url":"https://api.github.com/users/vahidhashemian/followers","following_url":"https://api.github.com/users/vahidhashemian/following{/other_user}","gists_url":"https://api.github.com/users/vahidhashemian/gists{/gist_id}","starred_url":"https://api.github.com/users/vahidhashemian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vahidhashemian/subscriptions","organizations_url":"https://api.github.com/users/vahidhashemian/orgs","repos_url":"https://api.github.com/users/vahidhashemian/repos","events_url":"https://api.github.com/users/vahidhashemian/events{/privacy}","received_events_url":"https://api.github.com/users/vahidhashemian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vahidhashemian/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/vahidhashemian/kafka","forks_url":"https://api.github.com/repos/vahidhashemian/kafka/forks","keys_url":"https://api.github.com/repos/vahidhashemian/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vahidhashemian/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vahidhashemian/kafka/teams","hooks_url":"https://api.github.com/repos/vahidhashemian/kafka/hooks","issue_events_url":"https://api.github.com/repos/vahidhashemian/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/vahidhashemian/kafka/events","assignees_url":"https://api.github.com/repos/vahidhashemian/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/vahidhashemian/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/vahidhashemian/kafka/tags","blobs_url":"https://api.github.com/repos/vahidhashemian/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vahidhashemian/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vahidhashemian/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/vahidhashemian/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vahidhashemian/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/vahidhashemian/kafka/languages","stargazers_url":"https://api.github.com/repos/vahidhashemian/kafka/stargazers","contributors_url":"https://api.github.com/repos/vahidhashemian/kafka/contributors","subscribers_url":"https://api.github.com/repos/vahidhashemian/kafka/subscribers","subscription_url":"https://api.github.com/repos/vahidhashemian/kafka/subscription","commits_url":"https://api.github.com/repos/vahidhashemian/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/vahidhashemian/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/vahidhashemian/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/vahidhashemian/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/vahidhashemian/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/vahidhashemian/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vahidhashemian/kafka/merges","archive_url":"https://api.github.com/repos/vahidhashemian/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vahidhashemian/kafka/downloads","issues_url":"https://api.github.com/repos/vahidhashemian/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/vahidhashemian/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/vahidhashemian/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/vahidhashemian/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vahidhashemian/kafka/labels{/name}","releases_url":"https://api.github.com/repos/vahidhashemian/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/vahidhashemian/kafka/deployments","created_at":"2015-12-04T21:04:22Z","updated_at":"2018-06-06T17:13:34Z","pushed_at":"2018-06-06T23:38:32Z","git_url":"git://github.com/vahidhashemian/kafka.git","ssh_url":"git@github.com:vahidhashemian/kafka.git","clone_url":"https://github.com/vahidhashemian/kafka.git","svn_url":"https://github.com/vahidhashemian/kafka","homepage":null,"size":66787,"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":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"trunk"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"c140603fa9670840f47774c694a8b2d7eddb5018","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","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,"node_id":"MDEwOlJlcG9zaXRvcnkyMjExMjQz","name":"kafka","full_name":"apache/kafka","owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","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-06-07T18:24:05Z","pushed_at":"2018-06-07T20:53:12Z","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":66977,"stargazers_count":8565,"watchers_count":8565,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4963,"mirror_url":null,"archived":false,"open_issues_count":456,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":4963,"open_issues":456,"watchers":8565,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/4896"},"html":{"href":"https://github.com/apache/kafka/pull/4896"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/4896"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/4896/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/4896/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/4896/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/a7450798111b560a4ca2d68444a34c899998ea7c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"hachikuji"}}