unknowntpo commented on code in PR #23858:
URL: https://github.com/apache/kafka/pull/23858#discussion_r4508357646


##########
metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java:
##########
@@ -1989,12 +1989,11 @@ void createPartitions(ControllerRequestContext context,
                 additional, e.throttleTimeMs());
             throw e;
         }
-        Iterator<PartitionRegistration> iterator = 
topicInfo.parts.values().iterator();
-        if (!iterator.hasNext()) {
+        PartitionRegistration partitionInfo = topicInfo.parts.get(0);

Review Comment:
   @chia7712 Thanks for checking. Reassignment skips this check on purpose, 
because it is the documented way to change the replication factor. KIP-860 kept 
this behavior as the default and added an opt-in guard 
(`--disallow-replication-factor-change`). If reassignment compared the target 
size with the current replication factor, users could not change it anymore.
   
   I also found a related bug. While partition 0 is being reassigned, its 
replica list holds both the old and the new replicas, so createPartitions gives 
new partitions too many replicas. I would like to open a separate JIRA for it. 
WDYT?



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