{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/220756984","pull_request_review_id":159239853,"id":220756984,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDc1Njk4NA==","diff_hunk":"@@ -264,6 +273,22 @@ private[log] class LogCleanerManager(val logDirs: Seq[File],\n     }\n   }\n \n+  /**\n+   *  Check if the cleaning for a partition is paused. The caller is expected to hold lock while making the call.\n+   */\n+  private def checkCleaningPaused(topicPartition: TopicPartition): Boolean = {","path":"core/src/main/scala/kafka/log/LogCleanerManager.scala","position":71,"original_position":71,"commit_id":"0c30f8db5e0da744c5978533168f79cff80b8026","original_commit_id":"0c30f8db5e0da744c5978533168f79cff80b8026","user":{"login":"lindong28","id":5873403,"node_id":"MDQ6VXNlcjU4NzM0MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/5873403?v=4","gravatar_id":"","url":"https://api.github.com/users/lindong28","html_url":"https://github.com/lindong28","followers_url":"https://api.github.com/users/lindong28/followers","following_url":"https://api.github.com/users/lindong28/following{/other_user}","gists_url":"https://api.github.com/users/lindong28/gists{/gist_id}","starred_url":"https://api.github.com/users/lindong28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lindong28/subscriptions","organizations_url":"https://api.github.com/users/lindong28/orgs","repos_url":"https://api.github.com/users/lindong28/repos","events_url":"https://api.github.com/users/lindong28/events{/privacy}","received_events_url":"https://api.github.com/users/lindong28/received_events","type":"User","site_admin":false},"body":"The existing method `checkCleaningAborted()` is a unit function which throw exception if the state is not `LogCleaningAborted`. The method `isCleaningInState(...)` returns boolean to indicate whether the state has the given value. It seems that the method we are adding here is closer to the `isCleaningInState(...)` since this method returns a boolean instead of throwing exception.","created_at":"2018-09-26T23:46:30Z","updated_at":"2018-09-26T23:46:30Z","html_url":"https://github.com/apache/kafka/pull/5694#discussion_r220756984","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/5694","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/220756984"},"html":{"href":"https://github.com/apache/kafka/pull/5694#discussion_r220756984"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/5694"}},"in_reply_to_id":220419915},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/5694","id":218159463,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4MTU5NDYz","html_url":"https://github.com/apache/kafka/pull/5694","diff_url":"https://github.com/apache/kafka/pull/5694.diff","patch_url":"https://github.com/apache/kafka/pull/5694.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/5694","number":5694,"state":"open","locked":false,"title":"KAFKA-7441; Allow LogCleanerManager.resumeCleaning() to be used concurrently","user":{"login":"xiowu0","id":41173730,"node_id":"MDQ6VXNlcjQxMTczNzMw","avatar_url":"https://avatars3.githubusercontent.com/u/41173730?v=4","gravatar_id":"","url":"https://api.github.com/users/xiowu0","html_url":"https://github.com/xiowu0","followers_url":"https://api.github.com/users/xiowu0/followers","following_url":"https://api.github.com/users/xiowu0/following{/other_user}","gists_url":"https://api.github.com/users/xiowu0/gists{/gist_id}","starred_url":"https://api.github.com/users/xiowu0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiowu0/subscriptions","organizations_url":"https://api.github.com/users/xiowu0/orgs","repos_url":"https://api.github.com/users/xiowu0/repos","events_url":"https://api.github.com/users/xiowu0/events{/privacy}","received_events_url":"https://api.github.com/users/xiowu0/received_events","type":"User","site_admin":false},"body":"KAFKA-7322; This is a followup Fix. With previous fix, log retention thread can throw illegal state exception when race against topic deletion or truncation.\r\n\r\nThe following race can happen: 1) log retention set a topic partition to paused state 2) topic deletion come and see it is already in paused state and proceed 3) topic deletion removed the paused state 4)log retention tries to resume the same topic partition from a NONE state and throw out an exception.\r\n\r\n In order to fix this situation, we allow a topic partition to be paused multiple times.  In addition, a concurrent unit test is added to test race condition.\r\n\r\n\r\n*Summary of testing strategy (including rationale)\r\nSpecial cooked high concurrent unit test.\r\nIngesting latency to make the race condition happen in broker, and observed both the race happen and the current implementation handled it correctly.\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-26T00:48:11Z","updated_at":"2018-09-26T23:46:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df78b8506248f5b966fc33cad47dc934d4648755","assignee":{"login":"lindong28","id":5873403,"node_id":"MDQ6VXNlcjU4NzM0MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/5873403?v=4","gravatar_id":"","url":"https://api.github.com/users/lindong28","html_url":"https://github.com/lindong28","followers_url":"https://api.github.com/users/lindong28/followers","following_url":"https://api.github.com/users/lindong28/following{/other_user}","gists_url":"https://api.github.com/users/lindong28/gists{/gist_id}","starred_url":"https://api.github.com/users/lindong28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lindong28/subscriptions","organizations_url":"https://api.github.com/users/lindong28/orgs","repos_url":"https://api.github.com/users/lindong28/repos","events_url":"https://api.github.com/users/lindong28/events{/privacy}","received_events_url":"https://api.github.com/users/lindong28/received_events","type":"User","site_admin":false},"assignees":[{"login":"lindong28","id":5873403,"node_id":"MDQ6VXNlcjU4NzM0MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/5873403?v=4","gravatar_id":"","url":"https://api.github.com/users/lindong28","html_url":"https://github.com/lindong28","followers_url":"https://api.github.com/users/lindong28/followers","following_url":"https://api.github.com/users/lindong28/following{/other_user}","gists_url":"https://api.github.com/users/lindong28/gists{/gist_id}","starred_url":"https://api.github.com/users/lindong28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lindong28/subscriptions","organizations_url":"https://api.github.com/users/lindong28/orgs","repos_url":"https://api.github.com/users/lindong28/repos","events_url":"https://api.github.com/users/lindong28/events{/privacy}","received_events_url":"https://api.github.com/users/lindong28/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/5694/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/5694/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/5694/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/0c30f8db5e0da744c5978533168f79cff80b8026","head":{"label":"xiowu0:fixrace2","ref":"fixrace2","sha":"0c30f8db5e0da744c5978533168f79cff80b8026","user":{"login":"xiowu0","id":41173730,"node_id":"MDQ6VXNlcjQxMTczNzMw","avatar_url":"https://avatars3.githubusercontent.com/u/41173730?v=4","gravatar_id":"","url":"https://api.github.com/users/xiowu0","html_url":"https://github.com/xiowu0","followers_url":"https://api.github.com/users/xiowu0/followers","following_url":"https://api.github.com/users/xiowu0/following{/other_user}","gists_url":"https://api.github.com/users/xiowu0/gists{/gist_id}","starred_url":"https://api.github.com/users/xiowu0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiowu0/subscriptions","organizations_url":"https://api.github.com/users/xiowu0/orgs","repos_url":"https://api.github.com/users/xiowu0/repos","events_url":"https://api.github.com/users/xiowu0/events{/privacy}","received_events_url":"https://api.github.com/users/xiowu0/received_events","type":"User","site_admin":false},"repo":{"id":145757337,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU3NTczMzc=","name":"kafka","full_name":"xiowu0/kafka","private":false,"owner":{"login":"xiowu0","id":41173730,"node_id":"MDQ6VXNlcjQxMTczNzMw","avatar_url":"https://avatars3.githubusercontent.com/u/41173730?v=4","gravatar_id":"","url":"https://api.github.com/users/xiowu0","html_url":"https://github.com/xiowu0","followers_url":"https://api.github.com/users/xiowu0/followers","following_url":"https://api.github.com/users/xiowu0/following{/other_user}","gists_url":"https://api.github.com/users/xiowu0/gists{/gist_id}","starred_url":"https://api.github.com/users/xiowu0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiowu0/subscriptions","organizations_url":"https://api.github.com/users/xiowu0/orgs","repos_url":"https://api.github.com/users/xiowu0/repos","events_url":"https://api.github.com/users/xiowu0/events{/privacy}","received_events_url":"https://api.github.com/users/xiowu0/received_events","type":"User","site_admin":false},"html_url":"https://github.com/xiowu0/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/xiowu0/kafka","forks_url":"https://api.github.com/repos/xiowu0/kafka/forks","keys_url":"https://api.github.com/repos/xiowu0/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xiowu0/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xiowu0/kafka/teams","hooks_url":"https://api.github.com/repos/xiowu0/kafka/hooks","issue_events_url":"https://api.github.com/repos/xiowu0/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/xiowu0/kafka/events","assignees_url":"https://api.github.com/repos/xiowu0/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/xiowu0/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/xiowu0/kafka/tags","blobs_url":"https://api.github.com/repos/xiowu0/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xiowu0/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xiowu0/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/xiowu0/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xiowu0/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/xiowu0/kafka/languages","stargazers_url":"https://api.github.com/repos/xiowu0/kafka/stargazers","contributors_url":"https://api.github.com/repos/xiowu0/kafka/contributors","subscribers_url":"https://api.github.com/repos/xiowu0/kafka/subscribers","subscription_url":"https://api.github.com/repos/xiowu0/kafka/subscription","commits_url":"https://api.github.com/repos/xiowu0/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/xiowu0/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/xiowu0/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/xiowu0/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/xiowu0/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/xiowu0/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xiowu0/kafka/merges","archive_url":"https://api.github.com/repos/xiowu0/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xiowu0/kafka/downloads","issues_url":"https://api.github.com/repos/xiowu0/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/xiowu0/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/xiowu0/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/xiowu0/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xiowu0/kafka/labels{/name}","releases_url":"https://api.github.com/repos/xiowu0/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/xiowu0/kafka/deployments","created_at":"2018-08-22T20:07:27Z","updated_at":"2018-09-17T17:51:16Z","pushed_at":"2018-09-26T00:38:49Z","git_url":"git://github.com/xiowu0/kafka.git","ssh_url":"git@github.com:xiowu0/kafka.git","clone_url":"https://github.com/xiowu0/kafka.git","svn_url":"https://github.com/xiowu0/kafka","homepage":null,"size":73745,"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":"master"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"f712ce69fc2cb6a164b1ea8e491c9d68e6661933","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-26T23:29:00Z","pushed_at":"2018-09-26T22:40:00Z","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":73912,"stargazers_count":9711,"watchers_count":9711,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5463,"mirror_url":null,"archived":false,"open_issues_count":509,"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":5463,"open_issues":509,"watchers":9711,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/5694"},"html":{"href":"https://github.com/apache/kafka/pull/5694"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/5694"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/5694/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/5694/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/5694/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/0c30f8db5e0da744c5978533168f79cff80b8026"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"lindong28"}}