dongeforever commented on code in PR #4521:
URL: https://github.com/apache/rocketmq/pull/4521#discussion_r910559096
##########
store/src/main/java/org/apache/rocketmq/store/CommitLog.java:
##########
@@ -604,6 +604,14 @@ private String generateKey(StringBuilder keyBuilder,
MessageExt messageExt) {
return keyBuilder.toString();
}
+ public void updateMaxMessageSize(PutMessageThreadLocal
putMessageThreadLocal) {
+ // dynamically adjust maxMessageSize, but not support DLedger mode
temporarily
+ int newMaxMessageSize =
this.defaultMessageStore.getMessageStoreConfig().getMaxMessageSize();
+ if (putMessageThreadLocal.getEncoder().getMaxMessageBodySize() !=
newMaxMessageSize) {
+
putMessageThreadLocal.getEncoder().updateEncoderBufferCapacity(newMaxMessageSize);
+ }
Review Comment:
It is better to do some checks to prevent negeative values.
if (newMaxMessageSize < 10) {
return
}
--
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]