You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "poorbarcode (via GitHub)" <gi...@apache.org> on 2025/06/12 17:03:15 UTC

[PR] [fix][ml] Cursor ignores the position that has an empty ack-set if disabled deletionAtBatchIndexLevelEnabled [pulsar]

poorbarcode opened a new pull request, #24406:
URL: https://github.com/apache/pulsar/pull/24406

   ### Motivation
   
   After disabling `deletionAtBatchIndexLevelEnabled`, `ManagedCursorImpl` ignores positions that have an empty `ackSet` when calling `cursor.delete`, which leads to the caller acknowledging nothing.
   
   And the Transaction task will acknowledge positions that have an empty `ackSet` after all single messages of a batch were acknowledged, 
   
   - https://github.com/apache/pulsar/blob/master/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/util/PositionAckSetUtil.java#L52 
   ```java
       public static void andAckSet(Position currentPosition, Position otherPosition) {
           if (currentPosition == null || otherPosition == null) {
               return;
           }
           AckSetState currentAckSetState = AckSetStateUtil.getAckSetState(currentPosition);
           AckSetState otherAckSetState = AckSetStateUtil.getAckSetState(otherPosition);
           // The ackSet will be an empty long array after the latest single message of a batch was acked.
           currentAckSetState.setAckSet(andAckSet(currentAckSetState.getAckSet(), otherAckSetState.getAckSet()));
       }
   ```
   
   - https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java#L804
   
   ```java
   private void handleIndividualAck(TxnID txnID, List<MutablePair<Position, Integer>> positions) {
        ...
        if (pendingAckMessageForCurrentTxn.containsKey(position)) {
             PositionAckSetUtil.andAckSet(pendingAckMessageForCurrentTxn.get(position), position);
         }
        ...
   }
   ```
   
   ### Modifications
   
   Fix the bug
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: x
   


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

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


Re: [PR] [fix][ml] Cursor ignores the position that has an empty ack-set if disabled deletionAtBatchIndexLevelEnabled [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #24406:
URL: https://github.com/apache/pulsar/pull/24406#issuecomment-2988715252

   @poorbarcode What Pulsar versions are impacted by this bug? In other words, when did we introduce this regression?


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

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


Re: [PR] [fix][ml] Cursor ignores the position that has an empty ack-set if disabled deletionAtBatchIndexLevelEnabled [pulsar]

Posted by "dao-jun (via GitHub)" <gi...@apache.org>.
dao-jun merged PR #24406:
URL: https://github.com/apache/pulsar/pull/24406


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

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