Skip to content

Commit

Permalink
[ISSUE #8669] Fix crc 32 overflow when lmq
Browse files Browse the repository at this point in the history
  • Loading branch information
DongyuanPan authored Sep 11, 2024
1 parent f43d9d1 commit ba8148f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion store/src/main/java/org/apache/rocketmq/store/CommitLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -1834,12 +1834,13 @@ class DefaultAppendMessageCallback implements AppendMessageCallback {
private static final int END_FILE_MIN_BLANK_LENGTH = 4 + 4;
// Store the message content
private final ByteBuffer msgStoreItemMemory;
private final int crc32ReservedLength = enabledAppendPropCRC ? CommitLog.CRC32_RESERVED_LEN : 0;
private final int crc32ReservedLength;
private final MessageStoreConfig messageStoreConfig;

DefaultAppendMessageCallback(MessageStoreConfig messageStoreConfig) {
this.msgStoreItemMemory = ByteBuffer.allocate(END_FILE_MIN_BLANK_LENGTH);
this.messageStoreConfig = messageStoreConfig;
this.crc32ReservedLength = messageStoreConfig.isEnabledAppendPropCRC() ? CommitLog.CRC32_RESERVED_LEN : 0;
}

public AppendMessageResult handlePropertiesForLmqMsg(ByteBuffer preEncodeBuffer,
Expand Down

0 comments on commit ba8148f

Please sign in to comment.