squah-confluent commented on code in PR #22969:
URL: https://github.com/apache/kafka/pull/22969#discussion_r3730217350


##########
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:
   Sure! That check is cheaper so it makes sense to do it first.



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