leizhiyuan commented on issue #8549: URL: https://github.com/apache/rocketmq/issues/8549#issuecomment-2298289893
应该是这行代码没有考虑ipv6的情况 ``` @Override public long getEarliestMessageTime() { long minPhyOffset = this.getMinPhyOffset(); if (this.getCommitLog() instanceof DLedgerCommitLog) { minPhyOffset += DLedgerEntry.BODY_OFFSET; } final int size = MessageDecoder.MESSAGE_STORE_TIMESTAMP_POSITION + 8; return this.getCommitLog().pickupStoreTimestamp(minPhyOffset, size); } ``` 这里的是56+8 public long pickupStoreTimestamp(final long offset, final int size) { if (offset >= this.getMinOffset() && offset + size <= this.getMaxOffset()) { SelectMappedBufferResult result = this.getMessage(offset, size); if (null != result) { try { int sysFlag = result.getByteBuffer().getInt(MessageDecoder.SYSFLAG_POSITION); int bornhostLength = (sysFlag & MessageSysFlag.BORNHOST_V6_FLAG) == 0 ? 8 : 20; int msgStoreTimePos = 4 + 4 + 4 + 4 + 4 + 8 + 8 + 4 + 8 + bornhostLength; return result.getByteBuffer().getLong(msgStoreTimePos); } finally { result.release(); } } } return -1; } 里面如果是ipv4,获取的是56:56+8(long) 如果是ipv6,就会越界,要获取68:68+8 -- 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