chia7712 commented on code in PR #20358: URL: https://github.com/apache/kafka/pull/20358#discussion_r2310172351
########## clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java: ########## @@ -514,7 +514,12 @@ public int splitAndReenqueue(ProducerBatch bigBatch) { // the split doesn't happen too often. CompressionRatioEstimator.setEstimation(bigBatch.topicPartition.topic(), compression.type(), Math.max(1.0f, (float) bigBatch.compressionRatio())); - Deque<ProducerBatch> dq = bigBatch.split(this.batchSize); + int targetSplitBatchSize = this.batchSize; + + if (bigBatch.isSplitBatch()) { + targetSplitBatchSize = Math.max(bigBatch.maxRecordSize, bigBatch.estimatedSizeInBytes() / 2); Review Comment: Out of curiosity, what happens if the single-record batch is still larger than `message.max.bytes`? -- 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