junrao commented on code in PR #20285:
URL: https://github.com/apache/kafka/pull/20285#discussion_r2389360602


##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/RecordAccumulatorTest.java:
##########
@@ -1062,6 +1062,146 @@ public void testSplitAndReenqueue() throws 
ExecutionException, InterruptedExcept
         assertEquals(1, future2.get().offset());
     }
 
+    // This test confirms us that splitting a single large record

Review Comment:
   We have the following code in Sender. It only tries to split the batch if it 
has more than 1 record. So, the splitting shouldn't occur forever.
   
   ```
       private void completeBatch(ProducerBatch batch, 
ProduceResponse.PartitionResponse response, long correlationId,
                                  long now, Map<TopicPartition, 
Metadata.LeaderIdAndEpoch> partitionsWithUpdatedLeaderInfo) {
           Errors error = response.error;
   
           if (error == Errors.MESSAGE_TOO_LARGE && batch.recordCount > 1 && 
!batch.isDone() &&
                   (batch.magic() >= RecordBatch.MAGIC_VALUE_V2 || 
batch.isCompressed())) {
               ...
               this.accumulator.splitAndReenqueue(batch);
   ```



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