nodece commented on code in PR #24376:
URL: https://github.com/apache/pulsar/pull/24376#discussion_r2127863751


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java:
##########
@@ -596,6 +597,8 @@ private CompletableFuture<Long> 
individualAckNormal(CommandAck ack, Map<String,
                 if (checkCanRemovePendingAcksAndHandle(ackOwnerConsumer, 
position, msgId)) {
                     addAndGetUnAckedMsgs(ackOwnerConsumer, -(int) ackedCount);
                     updateBlockedConsumerOnUnackedMsgs(ackOwnerConsumer);
+                } else if (Subscription.isCumulativeAckMode(subType)) {

Review Comment:
   This method only handles the individual ack, so you can remove this check.
   
   I think you should change `checkCanRemovePendingAcksAndHandle`:
   ```
       private boolean checkCanRemovePendingAcksAndHandle(PositionImpl 
position, MessageIdData msgId) {
           if (msgId.getAckSetsCount() == 0) {
               if (Subscription.isIndividualAckMode(subType)) {
                   return removePendingAcks(position);
               }
               // Exclusive model
               return true;
           }
           return false;
       }
   ```
   



-- 
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...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to