RongtongJin commented on code in PR #4469:
URL: https://github.com/apache/rocketmq/pull/4469#discussion_r899120453


##########
store/src/main/java/org/apache/rocketmq/store/CommitLog.java:
##########
@@ -1480,11 +1480,15 @@ public static class MessageExtEncoder {
         private final ByteBuf byteBuf;
         // The maximum length of the message body.
         private final int maxMessageBodySize;
-
+        // The maximum length of the full message.
+        private final int maxMessageSize;
         MessageExtEncoder(final int maxMessageBodySize) {
             ByteBufAllocator alloc = UnpooledByteBufAllocator.DEFAULT;
-            byteBuf = alloc.directBuffer(maxMessageBodySize);
+            //Reserve 64kb for encoding buffer outside body
+            int maxMessageSize = maxMessageBodySize + 64 * 1024;
+            byteBuf = alloc.directBuffer(maxMessageSize);

Review Comment:
   Hi, I wonder to know why it is 64KB?



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