kafka
kafka copied to clipboard
Shuffle the order of readPartitionInfo when fetching data.
Improve fairness of partition fetch order when clients fetch data to avoid partition starvation.
Randomly shuffles the readPartitionInfo sequence before iterating over it in the log read process.
This change helps to avoid persistent partition hotspots and ensures fairer resource utilization when processing fetch requests.
By shuffling the partitions, it prevents certain partitions from always being processed later, reducing the risk of starvation.
The performance impact is negligible since the list is typically small.
see https://issues.apache.org/jira/browse/KAFKA-19415