gaurav-narula commented on code in PR #23610:
URL: https://github.com/apache/kafka/pull/23610#discussion_r4249699716


##########
core/src/main/scala/kafka/zk/migration/ZkTopicMigrationClient.scala:
##########
@@ -77,26 +78,31 @@ class ZkTopicMigrationClient(zkClient: KafkaZkClient) 
extends TopicMigrationClie
             .setReplicas(replicaList)
             
.setAddingReplicas(replicaAssignment.addingReplicas.map(Integer.valueOf).asJava)
             
.setRemovingReplicas(replicaAssignment.removingReplicas.map(Integer.valueOf).asJava)
-          leaderIsrAndControllerEpochs.get(topicPartition) match {
+          val recordToVisit = leaderIsrAndControllerEpochs.get(topicPartition) 
match {
             case Some(leaderIsrAndEpoch) =>
-              record
+              Some(record
                 
.setIsr(leaderIsrAndEpoch.leaderAndIsr.isr.map(Integer.valueOf).asJava)
                 .setLeader(leaderIsrAndEpoch.leaderAndIsr.leader)
                 .setLeaderEpoch(leaderIsrAndEpoch.leaderAndIsr.leaderEpoch)
                 
.setPartitionEpoch(leaderIsrAndEpoch.leaderAndIsr.partitionEpoch)
-                
.setLeaderRecoveryState(leaderIsrAndEpoch.leaderAndIsr.leaderRecoveryState.value())
-            case None =>
+                
.setLeaderRecoveryState(leaderIsrAndEpoch.leaderAndIsr.leaderRecoveryState.value()))
+            case None if visitPartitionsWithoutState =>

Review Comment:
   Thanks for this! I've adopted your suggestion and added a new method to 
`TopicVisitor` interface which defaults to doing nothing and overridden it in 
`ZkMigrationClient`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to