This is an automated email from the ASF dual-hosted git repository.

lizhimin 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 103b7bcc3c [ISSUE #10229] Fix server-side reset offset does not take 
effect for FIFO (orderly) pop consumers (#10230)
103b7bcc3c is described below

commit 103b7bcc3c5718c88360c672af40dab5ca6e3193
Author: qianye <[email protected]>
AuthorDate: Mon Mar 30 11:53:04 2026 +0800

    [ISSUE #10229] Fix server-side reset offset does not take effect for FIFO 
(orderly) pop consumers (#10230)
---
 .../rocketmq/broker/pop/PopConsumerService.java    | 41 ++++++++++++----------
 1 file changed, 23 insertions(+), 18 deletions(-)

diff --git 
a/broker/src/main/java/org/apache/rocketmq/broker/pop/PopConsumerService.java 
b/broker/src/main/java/org/apache/rocketmq/broker/pop/PopConsumerService.java
index e13a81b144..55a347b89a 100644
--- 
a/broker/src/main/java/org/apache/rocketmq/broker/pop/PopConsumerService.java
+++ 
b/broker/src/main/java/org/apache/rocketmq/broker/pop/PopConsumerService.java
@@ -19,6 +19,23 @@ package org.apache.rocketmq.broker.pop;
 import com.alibaba.fastjson2.JSON;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Stopwatch;
+import java.nio.ByteBuffer;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Objects;
+import java.util.Queue;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CompletionException;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicLong;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.tuple.Triple;
 import org.apache.rocketmq.broker.BrokerController;
@@ -52,24 +69,6 @@ import org.apache.rocketmq.store.pop.PopCheckPoint;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.nio.ByteBuffer;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Objects;
-import java.util.Queue;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.CompletionException;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.Semaphore;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicLong;
-
 public class PopConsumerService extends ServiceThread {
 
     private static final Logger log = 
LoggerFactory.getLogger(LoggerName.ROCKETMQ_POP_LOGGER_NAME);
@@ -287,6 +286,12 @@ public class PopConsumerService extends ServiceThread {
     }
 
     public boolean isFifoBlocked(PopConsumerContext context, String groupId, 
String topicId, int queueId) {
+        // If server-side reset offset is enabled, and there is a reset offset,
+        // then return false to make sure that the reset offset takes effect.
+        if (brokerController.getBrokerConfig().isUseServerSideResetOffset() &&
+            
this.brokerController.getConsumerOffsetManager().hasOffsetReset(topicId, 
groupId, queueId)) {
+            return false;
+        }
         return brokerController.getConsumerOrderInfoManager().checkBlock(
             context.getAttemptId(), topicId, groupId, queueId, 
context.getInvisibleTime());
     }

Reply via email to