nileshkumar3 commented on code in PR #22969:
URL: https://github.com/apache/kafka/pull/22969#discussion_r3670730750


##########
coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java:
##########
@@ -960,7 +960,8 @@ private void append(
                         recordsToAppend
                     );
 
-                    if 
(!currentBatch.builder.hasRoomFor(estimatedSizeUpperBound)) {
+                    if 
(!currentBatch.builder.hasRoomFor(estimatedSizeUpperBound) &&
+                        currentBatch.builder.numRecords() > 0) {

Review Comment:
   Optional: consider reordering this condition to 
`currentBatch.builder.numRecords() > 0 && 
!currentBatch.builder.hasRoomFor(estimatedSizeUpperBound)` so 



##########
coordinator-common/src/test/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntimeTest.java:
##########
@@ -5338,6 +5338,72 @@ public void 
testCompressibleRecordTriggersFlushAndSucceeds() throws Exception {
         assertEquals("response2", write2.get(5, TimeUnit.SECONDS));
     }
 
+    @Test
+    public void testLargeCompressibleRecordSucceeds() throws Exception {

Review Comment:
   can we add  regression test for a large uncompressible record when the 
current batch was just allocated and is still empty?



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