File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
store/src/main/java/org/apache/rocketmq/store Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -564,8 +564,10 @@ public void correctMinOffset(long minCommitLogOffset) {
564564 SelectMappedBufferResult lastRecord = null ;
565565 try {
566566 int maxReadablePosition = lastMappedFile .getReadPosition ();
567- lastRecord = lastMappedFile .selectMappedBuffer (maxReadablePosition - ConsumeQueue .CQ_STORE_UNIT_SIZE ,
568- ConsumeQueue .CQ_STORE_UNIT_SIZE );
567+ if (maxReadablePosition >= ConsumeQueue .CQ_STORE_UNIT_SIZE ) {
568+ lastRecord = lastMappedFile .selectMappedBuffer (maxReadablePosition - ConsumeQueue .CQ_STORE_UNIT_SIZE ,
569+ ConsumeQueue .CQ_STORE_UNIT_SIZE );
570+ }
569571 if (null != lastRecord ) {
570572 ByteBuffer buffer = lastRecord .getByteBuffer ();
571573 long commitLogOffset = buffer .getLong ();
You can’t perform that action at this time.
0 commit comments