You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/02/26 23:43:16 UTC

[GitHub] [kafka] junrao commented on a change in pull request #10184: MINOR: enable topic deletion in the KIP-500 controller

junrao commented on a change in pull request #10184:
URL: https://github.com/apache/kafka/pull/10184#discussion_r583984728



##########
File path: metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java
##########
@@ -349,6 +357,16 @@ public void replay(PartitionChangeRecord record) {
         log.debug("Applied ISR change record: {}", record.toString());
     }
 
+    public void replay(RemoveTopicRecord record) {
+        TopicControlInfo topic = topics.remove(record.topicId());
+        if (topic == null) {
+            throw new RuntimeException("Can't find topic with ID " + record.topicId() +
+                " to remove.");
+        }
+        topicsByName.remove(topic.name);
+        log.info("Removed topic {} with ID {}.", topic.name, record.topicId());
+    }

Review comment:
       I guess we haven't hooked up the logic to trigger the deletion of the replicas of the deleted topic in the broker?

##########
File path: metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java
##########
@@ -349,6 +357,16 @@ public void replay(PartitionChangeRecord record) {
         log.debug("Applied ISR change record: {}", record.toString());
     }
 
+    public void replay(RemoveTopicRecord record) {
+        TopicControlInfo topic = topics.remove(record.topicId());
+        if (topic == null) {
+            throw new RuntimeException("Can't find topic with ID " + record.topicId() +
+                " to remove.");
+        }
+        topicsByName.remove(topic.name);

Review comment:
       Should we update brokersToIsrs too?




----------------------------------------------------------------
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:
users@infra.apache.org