Skip to content

Commit 90b0906

Browse files
guyinyouguyinyou
andauthored
[ISSUE #10038] Fix checkCommitLogOffsetOnRecover to skip validation for BLANK_MAGIC_CODE messages (#10039)
Change-Id: If1913db5155fe4135f2dbd1b58417b3afc6748c1 Co-authored-by: guyinyou <[email protected]>
1 parent 50e7ffa commit 90b0906

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

store/src/main/java/org/apache/rocketmq/store/CommitLog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ public void recoverAbnormally(long maxPhyOffsetOfConsumeQueue) throws RocksDBExc
795795
int size = dispatchRequest.getMsgSize();
796796
if (dispatchRequest.isSuccess()) {
797797
// Check commitlog offset validity if enabled
798-
if (checkCommitLogOffsetOnRecover) {
798+
if (size > 0 && checkCommitLogOffsetOnRecover) {
799799
if (dispatchRequest.getCommitLogOffset() < mappedFile.getFileFromOffset()
800800
|| dispatchRequest.getCommitLogOffset() > mappedFile.getFileFromOffset() + mappedFile.getFileSize()) {
801801
log.warn("found illegal commitlog offset {} in {}, current pos={}, it will be truncated.",

0 commit comments

Comments
 (0)