ivanyu commented on code in PR #19850:
URL: https://github.com/apache/kafka/pull/19850#discussion_r3330120603


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/BuiltInPartitioner.java:
##########
@@ -293,18 +324,55 @@ public void updatePartitionLoadStats(int[] queueSizes, 
int[] partitionIds, int l
             // and we didn't exclude partitions that experience high latencies 
(greater than
             // partitioner.availability.timeout.ms).
             log.trace("All queue lengths are the same, not using adaptive for 
topic {}", topic);
-            partitionLoadStats = null;
+            partitionLoadStatsHolder = null;
             return;
         }
 
+        // Before inverting and folding, build fully the load stats for this 
rack, because this depends on the raw queue sizes.
+        PartitionLoadStats partitionLoadStatsInThisRack = 
createPartitionLoadStatsForThisRackIfNeeded(queueSizes, partitionIds, 
partitionLeaderRacks, length);
+
         // Invert and fold the queue size, so that they become separator 
values in the CFT.
+        invertAndFoldQueueSizeArray(queueSizes, maxSizePlus1, length);
+
+        log.trace("Partition load stats for topic {}: CFT={}, IDs={}, 
length={}",

Review Comment:
   Please have a look: https://github.com/apache/kafka/pull/22434



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