dhruvilshah3 commented on a change in pull request #8609:
URL: https://github.com/apache/kafka/pull/8609#discussion_r420238891



##########
File path: core/src/main/scala/kafka/controller/ControllerChannelManager.scala
##########
@@ -550,6 +550,22 @@ abstract class 
AbstractControllerBrokerRequestBatch(config: KafkaConfig,
       else if (config.interBrokerProtocolVersion >= KAFKA_2_2_IV0) 1
       else 0
 
+    def responseCallback(brokerId: Int, isPartitionDeleted: TopicPartition => 
Boolean)
+                        (response: AbstractResponse): Unit = {
+      val stopReplicaResponse = response.asInstanceOf[StopReplicaResponse]
+      val partitionErrorsForDeletingTopics = mutable.Map.empty[TopicPartition, 
Errors]
+      stopReplicaResponse.partitionErrors.asScala.foreach { pe =>
+        val tp = new TopicPartition(pe.topicName, pe.partitionIndex)
+        if (controllerContext.isTopicDeletionInProgress(pe.topicName) &&
+            isPartitionDeleted(tp)) {
+          partitionErrorsForDeletingTopics += tp -> 
Errors.forCode(pe.errorCode)

Review comment:
       nit: `partitionErrorsForDeletingTopics` seems a bit ambiguous and makes 
it sound like it only includes partitions for which StopReplicaRequest failed. 
Perhaps something like `partitionToError` is better?




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