CalvinConfluent commented on code in PR #19916: URL: https://github.com/apache/kafka/pull/19916#discussion_r2132832648
########## metadata/src/main/java/org/apache/kafka/image/TopicsDelta.java: ########## @@ -95,26 +95,37 @@ public void replay(PartitionChangeRecord record) { topicDelta.replay(record); } + private void maybeReplayClearElrRecord(Uuid topicId, ClearElrRecord record) { + // Only apply the record if the topic is not deleted. + if (!deletedTopicIds.contains(topicId)) { + TopicDelta topicDelta = getOrCreateTopicDelta(topicId); + topicDelta.replay(record); + } + } + public void replay(ClearElrRecord record) { if (!record.topicName().isEmpty()) { Uuid topicId; - if (image.getTopic(record.topicName()) != null) { - topicId = image.getTopic(record.topicName()).id(); - } else { + if (createdTopics.containsKey(record.topicName())) { topicId = createdTopics.get(record.topicName()); + } else { + topicId = image.getTopic(record.topicName()).id(); Review Comment: Good catch. Updated with a new UT. -- 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. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org