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

jt2594838 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 7d2e7e5e545 Fix late subscription ACK handling (#19303)
7d2e7e5e545 is described below

commit 7d2e7e5e545a8c4fc797b2097fbce39f9a5afd38
Author: Caideyipi <[email protected]>
AuthorDate: Wed Nov 18 11:53:54 2026 +0800

    Fix late subscription ACK handling (#19303)
---
 .../db/subscription/broker/consensus/ConsensusPrefetchingQueue.java | 6 +++---
 .../broker/consensus/ConsensusPrefetchingQueueTest.java             | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/broker/consensus/ConsensusPrefetchingQueue.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/broker/consensus/ConsensusPrefetchingQueue.java
index a2e5b71c7ee..3db9deee216 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/broker/consensus/ConsensusPrefetchingQueue.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/broker/consensus/ConsensusPrefetchingQueue.java
@@ -3758,10 +3758,10 @@ public class ConsensusPrefetchingQueue {
       }
 
       final SubscriptionEvent event = 
outstandingEventsByCommitContext.get(commitContext);
-      // A recycled event may already have been claimed by another consumer. 
Only an event that is
-      // still queued can be committed by the previous consumer's late ACK.
+      // A recycled event may already have been claimed by another consumer. 
Accept the late ACK as
+      // a no-op and leave the event for its current owner to commit.
       if (Objects.nonNull(event) && !prefetchingQueue.remove(event)) {
-        return false;
+        return true;
       }
 
       final WriterId commitWriterId = extractCommitWriterId(commitContext);
diff --git 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/subscription/broker/consensus/ConsensusPrefetchingQueueTest.java
 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/subscription/broker/consensus/ConsensusPrefetchingQueueTest.java
index 84ec91d34bc..30610e6554f 100644
--- 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/subscription/broker/consensus/ConsensusPrefetchingQueueTest.java
+++ 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/subscription/broker/consensus/ConsensusPrefetchingQueueTest.java
@@ -3745,7 +3745,7 @@ public class ConsensusPrefetchingQueueTest {
 
       final SubscriptionEvent redeliveredEvent = queue.poll("newConsumer");
       assertTrue(redeliveredEvent == event);
-      assertFalse(queue.ack("oldConsumer", event.getCommitContext()));
+      assertTrue(queue.ackSilent("oldConsumer", event.getCommitContext()));
       assertEquals(1L, queue.getSubscriptionUncommittedEventCount());
       assertEquals(0, queue.getPrefetchedEventCount());
       assertEquals(retainedBytes, queue.getRetainedTabletBytes());

Reply via email to