{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/218147757","pull_request_review_id":156017411,"id":218147757,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODE0Nzc1Nw==","diff_hunk":"@@ -157,25 +158,44 @@ private void startRestoration(final Map<TopicPartition, StateRestorer> initializ\n \n         final List<StateRestorer> needsPositionUpdate = new ArrayList<>();\n         for (final StateRestorer restorer : initialized.values()) {\n+            final TopicPartition restoringPartition = restorer.partition();\n             if (restorer.checkpoint() != StateRestorer.NO_CHECKPOINT) {\n-                consumer.seek(restorer.partition(), restorer.checkpoint());\n-                logRestoreOffsets(restorer.partition(),\n-                        restorer.checkpoint(),\n-                        endOffsets.get(restorer.partition()));\n-                restorer.setStartingOffset(consumer.position(restorer.partition()));\n+                consumer.seek(restoringPartition, restorer.checkpoint());\n+                logRestoreOffsets(restoringPartition,\n+                                  restorer.checkpoint(),\n+                                  endOffsets.get(restoringPartition));\n+                restorer.setStartingOffset(consumer.position(restoringPartition));\n                 restorer.restoreStarted();\n             } else {\n-                consumer.seekToBeginning(Collections.singletonList(restorer.partition()));\n+                consumer.seekToBeginning(Collections.singletonList(restoringPartition));\n                 needsPositionUpdate.add(restorer);\n             }\n         }\n \n         for (final StateRestorer restorer : needsPositionUpdate) {\n-            final long position = consumer.position(restorer.partition());\n-            logRestoreOffsets(restorer.partition(),\n-                              position,\n-                              endOffsets.get(restorer.partition()));\n-            restorer.setStartingOffset(position);\n+            final TopicPartition restoringPartition = restorer.partition();\n+            final StreamTask task = active.restoringTaskFor(restoringPartition);\n+\n+            // If checkpoint does not exist it means the task was not shutdown gracefully before;\n+            // and in this case if EOS is turned on we should wipe out the state and re-initialize the task\n+            if (task.eosEnabled) {\n+                log.info(\"No checkpoint found for task {} state store {} changelog {} with EOS turned on. \" +\n+                    \"Reinitializing the task and restore its state from the beginning.\", task.id, restorer.storeName(), restoringPartition);\n+                needsInitializing.remove(restoringPartition);\n+\n+                initialized.put(restoringPartition, restorer);","path":"streams/src/main/java/org/apache/kafka/streams/processor/internals/StoreChangelogReader.java","position":84,"original_position":84,"commit_id":"c428adfe7d7082328ae49ace093bc17c6a841d85","original_commit_id":"c428adfe7d7082328ae49ace093bc17c6a841d85","user":{"login":"guozhangwang","id":10729597,"node_id":"MDQ6VXNlcjEwNzI5NTk3","avatar_url":"https://avatars0.githubusercontent.com/u/10729597?v=4","gravatar_id":"","url":"https://api.github.com/users/guozhangwang","html_url":"https://github.com/guozhangwang","followers_url":"https://api.github.com/users/guozhangwang/followers","following_url":"https://api.github.com/users/guozhangwang/following{/other_user}","gists_url":"https://api.github.com/users/guozhangwang/gists{/gist_id}","starred_url":"https://api.github.com/users/guozhangwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guozhangwang/subscriptions","organizations_url":"https://api.github.com/users/guozhangwang/orgs","repos_url":"https://api.github.com/users/guozhangwang/repos","events_url":"https://api.github.com/users/guozhangwang/events{/privacy}","received_events_url":"https://api.github.com/users/guozhangwang/received_events","type":"User","site_admin":false},"body":"In trunk we call `initialized.remove(partition);`, why it is changed here?","created_at":"2018-09-17T16:56:55Z","updated_at":"2018-09-17T16:59:04Z","html_url":"https://github.com/apache/kafka/pull/5657#discussion_r218147757","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/5657","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/218147757"},"html":{"href":"https://github.com/apache/kafka/pull/5657#discussion_r218147757"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/5657"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/5657","id":215739262,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1NzM5MjYy","html_url":"https://github.com/apache/kafka/pull/5657","diff_url":"https://github.com/apache/kafka/pull/5657.diff","patch_url":"https://github.com/apache/kafka/pull/5657.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/5657","number":5657,"state":"open","locked":false,"title":"KAFKA-7192: Wipe out state store if EOS is turned on and checkpoint file does not exist","user":{"login":"mjsax","id":8959638,"node_id":"MDQ6VXNlcjg5NTk2Mzg=","avatar_url":"https://avatars1.githubusercontent.com/u/8959638?v=4","gravatar_id":"","url":"https://api.github.com/users/mjsax","html_url":"https://github.com/mjsax","followers_url":"https://api.github.com/users/mjsax/followers","following_url":"https://api.github.com/users/mjsax/following{/other_user}","gists_url":"https://api.github.com/users/mjsax/gists{/gist_id}","starred_url":"https://api.github.com/users/mjsax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjsax/subscriptions","organizations_url":"https://api.github.com/users/mjsax/orgs","repos_url":"https://api.github.com/users/mjsax/repos","events_url":"https://api.github.com/users/mjsax/events{/privacy}","received_events_url":"https://api.github.com/users/mjsax/received_events","type":"User","site_admin":false},"body":"Unified backport of PRs #5421 and #5430\r\n\r\nAlso compare backport to `0.11.0` #5641\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-09-15T00:38:19Z","updated_at":"2018-09-17T16:59:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de4ac7d94ea10957356294e21834c8d6d2a04034","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":820747028,"node_id":"MDU6TGFiZWw4MjA3NDcwMjg=","url":"https://api.github.com/repos/apache/kafka/labels/streams","name":"streams","color":"63edea","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/5657/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/5657/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/5657/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/c428adfe7d7082328ae49ace093bc17c6a841d85","head":{"label":"mjsax:kafka-7192-eos-state-backport-10","ref":"kafka-7192-eos-state-backport-10","sha":"c428adfe7d7082328ae49ace093bc17c6a841d85","user":{"login":"mjsax","id":8959638,"node_id":"MDQ6VXNlcjg5NTk2Mzg=","avatar_url":"https://avatars1.githubusercontent.com/u/8959638?v=4","gravatar_id":"","url":"https://api.github.com/users/mjsax","html_url":"https://github.com/mjsax","followers_url":"https://api.github.com/users/mjsax/followers","following_url":"https://api.github.com/users/mjsax/following{/other_user}","gists_url":"https://api.github.com/users/mjsax/gists{/gist_id}","starred_url":"https://api.github.com/users/mjsax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjsax/subscriptions","organizations_url":"https://api.github.com/users/mjsax/orgs","repos_url":"https://api.github.com/users/mjsax/repos","events_url":"https://api.github.com/users/mjsax/events{/privacy}","received_events_url":"https://api.github.com/users/mjsax/received_events","type":"User","site_admin":false},"repo":{"id":50839421,"node_id":"MDEwOlJlcG9zaXRvcnk1MDgzOTQyMQ==","name":"kafka","full_name":"mjsax/kafka","private":false,"owner":{"login":"mjsax","id":8959638,"node_id":"MDQ6VXNlcjg5NTk2Mzg=","avatar_url":"https://avatars1.githubusercontent.com/u/8959638?v=4","gravatar_id":"","url":"https://api.github.com/users/mjsax","html_url":"https://github.com/mjsax","followers_url":"https://api.github.com/users/mjsax/followers","following_url":"https://api.github.com/users/mjsax/following{/other_user}","gists_url":"https://api.github.com/users/mjsax/gists{/gist_id}","starred_url":"https://api.github.com/users/mjsax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjsax/subscriptions","organizations_url":"https://api.github.com/users/mjsax/orgs","repos_url":"https://api.github.com/users/mjsax/repos","events_url":"https://api.github.com/users/mjsax/events{/privacy}","received_events_url":"https://api.github.com/users/mjsax/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mjsax/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/mjsax/kafka","forks_url":"https://api.github.com/repos/mjsax/kafka/forks","keys_url":"https://api.github.com/repos/mjsax/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mjsax/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mjsax/kafka/teams","hooks_url":"https://api.github.com/repos/mjsax/kafka/hooks","issue_events_url":"https://api.github.com/repos/mjsax/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/mjsax/kafka/events","assignees_url":"https://api.github.com/repos/mjsax/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/mjsax/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/mjsax/kafka/tags","blobs_url":"https://api.github.com/repos/mjsax/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mjsax/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mjsax/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/mjsax/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mjsax/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/mjsax/kafka/languages","stargazers_url":"https://api.github.com/repos/mjsax/kafka/stargazers","contributors_url":"https://api.github.com/repos/mjsax/kafka/contributors","subscribers_url":"https://api.github.com/repos/mjsax/kafka/subscribers","subscription_url":"https://api.github.com/repos/mjsax/kafka/subscription","commits_url":"https://api.github.com/repos/mjsax/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/mjsax/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/mjsax/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/mjsax/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/mjsax/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/mjsax/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mjsax/kafka/merges","archive_url":"https://api.github.com/repos/mjsax/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mjsax/kafka/downloads","issues_url":"https://api.github.com/repos/mjsax/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/mjsax/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/mjsax/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/mjsax/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mjsax/kafka/labels{/name}","releases_url":"https://api.github.com/repos/mjsax/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/mjsax/kafka/deployments","created_at":"2016-02-01T12:57:30Z","updated_at":"2018-09-11T22:22:50Z","pushed_at":"2018-09-15T00:36:58Z","git_url":"git://github.com/mjsax/kafka.git","ssh_url":"git@github.com:mjsax/kafka.git","clone_url":"https://github.com/mjsax/kafka.git","svn_url":"https://github.com/mjsax/kafka","homepage":null,"size":69627,"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":1,"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":1,"watchers":0,"default_branch":"trunk"}},"base":{"label":"apache:1.0","ref":"1.0","sha":"4866c33ac309ba5cc098a02948253f55a83666a3","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","private":false,"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},"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-09-17T16:36:54Z","pushed_at":"2018-09-17T16:35:14Z","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":72923,"stargazers_count":9630,"watchers_count":9630,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5430,"mirror_url":null,"archived":false,"open_issues_count":497,"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":5430,"open_issues":497,"watchers":9630,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/5657"},"html":{"href":"https://github.com/apache/kafka/pull/5657"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/5657"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/5657/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/5657/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/5657/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/c428adfe7d7082328ae49ace093bc17c6a841d85"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"guozhangwang"}}