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 2022/02/06 16:25:56 UTC

[GitHub] [kafka] lbradstreet commented on a change in pull request #11376: KAFKA-13342: LeaderAndIsrRequest should not be sent for topic queued for deletion

lbradstreet commented on a change in pull request #11376:
URL: https://github.com/apache/kafka/pull/11376#discussion_r800202592



##########
File path: core/src/main/scala/kafka/controller/ReplicaStateMachine.scala
##########
@@ -204,13 +204,17 @@ class ZkReplicaStateMachine(config: KafkaConfig,
                 controllerContext.updatePartitionFullReplicaAssignment(partition, newAssignment)
               }
             case _ =>
-              controllerContext.partitionLeadershipInfo(partition) match {
-                case Some(leaderIsrAndControllerEpoch) =>
-                  controllerBrokerRequestBatch.addLeaderAndIsrRequestForBrokers(Seq(replicaId),
-                    replica.topicPartition,
-                    leaderIsrAndControllerEpoch,
-                    controllerContext.partitionFullReplicaAssignment(partition), isNew = false)
-                case None =>
+              if (!controllerContext.isTopicQueuedUpForDeletion(partition.topic)) {
+                controllerContext.partitionLeadershipInfo(partition) match {
+                  case Some(leaderIsrAndControllerEpoch) =>
+                    controllerBrokerRequestBatch.addLeaderAndIsrRequestForBrokers(Seq(replicaId),
+                      replica.topicPartition,
+                      leaderIsrAndControllerEpoch,
+                      controllerContext.partitionFullReplicaAssignment(partition), isNew = false)
+                  case None =>
+                }
+              } else {
+                info(s"OnlineReplica is in deleting state $partition. Not adding it to the LeaderAndIsrRequest")

Review comment:
       Good point.




-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org