ni-ze commented on code in PR #4469:
URL: https://github.com/apache/rocketmq/pull/4469#discussion_r903208342
##########
store/src/main/java/org/apache/rocketmq/store/CommitLog.java:
##########
@@ -1482,11 +1482,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;
Review Comment:
IMO, variable parameters, which is properties and topic name, is limited and
properties before write into commitLog, if this two item length exceed limit,
it won't reach here.
and I think it is a little weird to limit length base on an auto scalable
ByteBuf.
--
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]