jolshan commented on code in PR #13111:
URL: https://github.com/apache/kafka/pull/13111#discussion_r1071409739


##########
core/src/main/scala/kafka/zk/KafkaZkClient.scala:
##########
@@ -602,14 +602,13 @@ class KafkaZkClient private[zk] (zooKeeperClient: 
ZooKeeperClient, isSecure: Boo
     val updatedAssignments = topicIdReplicaAssignments.map {
       case TopicIdReplicaAssignment(topic, None, assignments) =>
         TopicIdReplicaAssignment(topic, Some(Uuid.randomUuid()), assignments)
-      case TopicIdReplicaAssignment(topic, Some(_), _) =>
-        throw new IllegalArgumentException("TopicIdReplicaAssignment for " + 
topic + " already contains a topic ID.")
+      case t => t

Review Comment:
   Why did we just remove this check -- does the new code not function without 
it?



##########
core/src/main/scala/kafka/zk/KafkaZkClient.scala:
##########
@@ -602,14 +602,13 @@ class KafkaZkClient private[zk] (zooKeeperClient: 
ZooKeeperClient, isSecure: Boo
     val updatedAssignments = topicIdReplicaAssignments.map {
       case TopicIdReplicaAssignment(topic, None, assignments) =>
         TopicIdReplicaAssignment(topic, Some(Uuid.randomUuid()), assignments)
-      case TopicIdReplicaAssignment(topic, Some(_), _) =>
-        throw new IllegalArgumentException("TopicIdReplicaAssignment for " + 
topic + " already contains a topic ID.")
+      case t => t
     }.toSet
 
     val setDataRequests = updatedAssignments.map { case 
TopicIdReplicaAssignment(topic, topicIdOpt, assignments) =>
       SetDataRequest(TopicZNode.path(topic), TopicZNode.encode(topicIdOpt, 
assignments), ZkVersion.MatchAnyVersion)
     }.toSeq
-
+    

Review Comment:
   nit: spacing



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