yuz10 commented on code in PR #7599:
URL: https://github.com/apache/rocketmq/pull/7599#discussion_r1453601842


##########
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:
   if bortHost is ipv6, the offset should be 12 bytes larger



-- 
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

Reply via email to