bxfjb commented on code in PR #7599: URL: https://github.com/apache/rocketmq/pull/7599#discussion_r1454496926
########## store/src/main/java/org/apache/rocketmq/store/dledger/DLedgerCommitLog.java: ########## @@ -343,14 +427,48 @@ private void recover(long maxPhyOffsetOfConsumeQueue) throws RocksDBException { log.info("Will set the initial commitlog offset={} for dledger", dividedCommitlogOffset); } + private boolean isMmapFileMatchedRecover(final MmapFile mmapFile) { + ByteBuffer byteBuffer = mmapFile.sliceByteBuffer(); + + int magicCode = byteBuffer.getInt(DLedgerEntry.BODY_OFFSET + MessageDecoder.MESSAGE_MAGIC_CODE_POSITION); + if (magicCode != MESSAGE_MAGIC_CODE) { + return false; + } + + long storeTimestamp = byteBuffer.getLong(DLedgerEntry.BODY_OFFSET + MessageDecoder.MESSAGE_STORE_TIMESTAMP_POSITION); Review Comment: thanks a lot and fixed -- 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: commits-unsubscr...@rocketmq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org