This is an automated email from the ASF dual-hosted git repository.
jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new 7be720250e [ISSUE #10108] Broker startup fail in recover (#10109)
7be720250e is described below
commit 7be720250e6bf7cd2f5ceb66ad56b528d7f721d9
Author: yuz10 <[email protected]>
AuthorDate: Tue Feb 24 13:56:23 2026 +0800
[ISSUE #10108] Broker startup fail in recover (#10109)
---
store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java
b/store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java
index 1d16165c04..c430c6d7e1 100644
--- a/store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java
+++ b/store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java
@@ -564,8 +564,10 @@ public class ConsumeQueue implements ConsumeQueueInterface
{
SelectMappedBufferResult lastRecord = null;
try {
int maxReadablePosition = lastMappedFile.getReadPosition();
- lastRecord = lastMappedFile.selectMappedBuffer(maxReadablePosition
- ConsumeQueue.CQ_STORE_UNIT_SIZE,
- ConsumeQueue.CQ_STORE_UNIT_SIZE);
+ if (maxReadablePosition >= ConsumeQueue.CQ_STORE_UNIT_SIZE) {
+ lastRecord =
lastMappedFile.selectMappedBuffer(maxReadablePosition -
ConsumeQueue.CQ_STORE_UNIT_SIZE,
+ ConsumeQueue.CQ_STORE_UNIT_SIZE);
+ }
if (null != lastRecord) {
ByteBuffer buffer = lastRecord.getByteBuffer();
long commitLogOffset = buffer.getLong();