cmccabe commented on code in PR #17604:
URL: https://github.com/apache/kafka/pull/17604#discussion_r1819378728


##########
metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java:
##########
@@ -605,6 +605,16 @@ ControllerResult<CreateTopicsResponseData> createTopics(
         Map<ConfigResource, Map<String, Entry<OpType, String>>> configChanges =
             computeConfigChanges(topicErrors, request.topics());
 
+        int totalPartitions = 0;
+        for (CreatableTopic topic: request.topics()) {
+            if (topic.numPartitions() > 0) {
+                totalPartitions += topic.numPartitions();

Review Comment:
   This isn't quite right since we allow -1 as a special value for 
`numPartitions`. It means that we are explicitly specifying the partitions we 
want to create. These partitions should be counted towards the total too, of 
course.



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