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



##########
File path: core/src/main/scala/kafka/server/ReplicaManager.scala
##########
@@ -316,7 +324,7 @@ class ReplicaManager(val config: KafkaConfig,
   private def maybeRemoveTopicMetrics(topic: String): Unit = {
     val topicHasOnlinePartition = allPartitions.values.exists {
       case HostedPartition.Online(partition) => topic == partition.topic
-      case HostedPartition.None | HostedPartition.Offline => false
+      case _ => false

Review comment:
       This is one case we probably _do_ want to act in the deferred state. One 
option I was consider is whether we should expose `Partition` from 
`HostedPartition` as an option.
   ```scala
   sealed trait HostedPartition {
     def partition: Option[Partition]
   }
   ```
   Then we could refactor this as a `filter` or something. 




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