jolshan commented on a change in pull request #9473: URL: https://github.com/apache/kafka/pull/9473#discussion_r512081744
########## File path: core/src/main/scala/kafka/controller/ControllerContext.scala ########## @@ -295,6 +316,10 @@ class ControllerContext { topicsToBeDeleted -= topic topicsWithDeletionStarted -= topic allTopics -= topic + if (topicIds.get(topic)!= None) { + topicNames.remove(topicIds.get(topic).get) + topicIds.remove(topic) + } Review comment: I was thinking about this some more, and I don't think we will have a case where the topic ID is not in the map (the if conditional is not needed.) However, the suggestion you gave is still good because it prevents the extra lookup. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org