hachikuji commented on a change in pull request #10252:
URL: https://github.com/apache/kafka/pull/10252#discussion_r586695760



##########
File path: core/src/main/scala/kafka/server/metadata/MetadataPartitions.scala
##########
@@ -124,8 +125,30 @@ class MetadataPartitionsBuilder(val brokerId: Int,
 
   def removeTopicById(id: Uuid): Iterable[MetadataPartition] = {
     Option(newIdMap.remove(id)) match {
-      case None => throw new RuntimeException(s"Unable to locate topic with ID 
$id")
-      case Some(name) => newNameMap.remove(name).values().asScala
+      case None =>
+        throw new RuntimeException(s"Unable to locate topic with ID $id")
+
+      case Some(name) =>
+        newReverseIdMap.remove(name)
+
+        val prevPartitionMap = newNameMap.remove(name)

Review comment:
       Maybe we can just be a little defensive here and check it. 




----------------------------------------------------------------
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


Reply via email to