diff --git a/store/src/main/java/org/apache/rocketmq/store/CommitLog.java b/store/src/main/java/org/apache/rocketmq/store/CommitLog.java index e132a7a7dc2384912af425ba6b18419d0d6e6860..55f16ea96270a38c51aebc988851469f6bd22af7 100644 --- a/store/src/main/java/org/apache/rocketmq/store/CommitLog.java +++ b/store/src/main/java/org/apache/rocketmq/store/CommitLog.java @@ -171,7 +171,6 @@ public class CommitLog { ByteBuffer byteBuffer = mappedFile.sliceByteBuffer(); long processOffset = mappedFile.getFileFromOffset(); long mappedFileOffset = 0; - boolean isDamaged = false; while (true) { DispatchRequest dispatchRequest = this.checkMessageAndReturnSize(byteBuffer, checkCRCOnRecover); int size = dispatchRequest.getMsgSize(); @@ -210,7 +209,7 @@ public class CommitLog { this.mappedFileQueue.truncateDirtyFiles(processOffset); // Clear ConsumeQueue redundant data - if (isDamaged && maxPhyOffsetOfConsumeQueue >= processOffset) { + if (maxPhyOffsetOfConsumeQueue >= processOffset) { log.warn("maxPhyOffsetOfConsumeQueue({}) >= processOffset({}), truncate dirty logic files", maxPhyOffsetOfConsumeQueue, processOffset); this.defaultMessageStore.truncateDirtyLogicFiles(processOffset); }