chia7712 commented on code in PR #20847:
URL: https://github.com/apache/kafka/pull/20847#discussion_r2563459527


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorConfig.java:
##########
@@ -109,6 +110,10 @@ public class GroupCoordinatorConfig {
     public static final CompressionType 
OFFSETS_TOPIC_COMPRESSION_CODEC_DEFAULT = CompressionType.NONE;
     public static final String OFFSETS_TOPIC_COMPRESSION_CODEC_DOC = 
"Compression codec for the offsets topic - compression may be used to achieve 
\"atomic\" commits.";
 
+    public static final String APPEND_MAX_BUFFER_SIZE_CONFIG = 
"group.coordinator.append.max.buffer.size";
+    public static final int APPEND_MAX_BUFFER_SIZE_DEFAULT = 1024 * 1024 + 
Records.LOG_OVERHEAD;
+    public static final String APPEND_MAX_BUFFER_SIZE_DOC = "The largest 
buffer size allowed by GroupCoordinator (It is recommended not to exceed the 
maximum allowed message size).";

Review Comment:
   Could you update the documentation to describe what happens if the maximum 
message size is exceeded?



##########
coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java:
##########
@@ -901,10 +908,9 @@ private void maybeAllocateNewBatch(
             long currentTimeMs
         ) {
             if (currentBatch == null) {
-                LogConfig logConfig = partitionWriter.config(tp);
-                int maxBatchSize = logConfig.maxMessageSize();
+                int maxBatchSize = partitionWriter.config(tp).maxMessageSize();
                 long prevLastWrittenOffset = coordinator.lastWrittenOffset();
-                ByteBuffer buffer = 
bufferSupplier.get(min(INITIAL_BUFFER_SIZE, maxBatchSize));
+                ByteBuffer buffer = 
bufferSupplier.get(min(INITIAL_BUFFER_SIZE, appendMaxBufferSizeSupplier.get()));

Review Comment:
   I'm thinking the benefit of this change. WDYT?



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