hudeqi commented on code in PR #14667:
URL: https://github.com/apache/kafka/pull/14667#discussion_r1377023677


##########
core/src/main/scala/kafka/server/ReplicaManager.scala:
##########
@@ -630,13 +630,17 @@ class ReplicaManager(val config: KafkaConfig,
 
     // Third delete the logs and checkpoint.
     val errorMap = new mutable.HashMap[TopicPartition, Throwable]()
+    // `tieredEnabledPartitions` has exclude internal topics
+    val tieredEnabledPartitions = partitionsToStop.filter(sp => 
logManager.getLog(sp.topicPartition).exists(unifiedLog => 
unifiedLog.remoteLogEnabled()))

Review Comment:
   The calculation of `tieredEnabledPartitions` may not be placed after if{}, 
because `logManager.asyncDelete` will remove the corresponding unifiedLog from 
`currentLogs` in `logManager`, causing the calculation of 
`tieredEnabledPartitions` to be incorrect.
   1. The calculation of `tieredEnabledPartitions` actually has excluded 
internal topics, because 
https://github.com/apache/kafka/blob/8f8ad6db384ce30e8a5d848d3ed826a3f7a54dfe/core/src/main/scala/kafka/log/UnifiedLog.scala#L1887
   2. added.
   @divijvaidya 



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

Reply via email to