Skip to content

Conversation

@poorbarcode
Copy link
Contributor

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,

    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()));
    }
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

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: x

@poorbarcode poorbarcode added this to the 4.1.0 milestone Jun 12, 2025
@poorbarcode poorbarcode self-assigned this Jun 12, 2025
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jun 12, 2025
@dao-jun dao-jun merged commit 3bd70fd into apache:master Jun 13, 2025
103 of 106 checks passed
@lhotari
Copy link
Member

lhotari commented Jun 19, 2025

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

lhotari pushed a commit that referenced this pull request Jun 19, 2025
…sabled deletionAtBatchIndexLevelEnabled (#24406)

(cherry picked from commit 3bd70fd)
lhotari pushed a commit that referenced this pull request Jun 19, 2025
…sabled deletionAtBatchIndexLevelEnabled (#24406)

(cherry picked from commit 3bd70fd)
lhotari pushed a commit that referenced this pull request Jun 19, 2025
…sabled deletionAtBatchIndexLevelEnabled (#24406)

(cherry picked from commit 3bd70fd)
nodece pushed a commit to nodece/pulsar that referenced this pull request Jun 20, 2025
…sabled deletionAtBatchIndexLevelEnabled (apache#24406)

(cherry picked from commit 3bd70fd)
ganesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 20, 2025
…sabled deletionAtBatchIndexLevelEnabled (apache#24406)

(cherry picked from commit 3bd70fd)
(cherry picked from commit e10fce8)
ganesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 21, 2025
…sabled deletionAtBatchIndexLevelEnabled (apache#24406)

(cherry picked from commit 3bd70fd)
(cherry picked from commit 9883d92)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 24, 2025
…sabled deletionAtBatchIndexLevelEnabled (apache#24406)

(cherry picked from commit 3bd70fd)
(cherry picked from commit 9883d92)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 30, 2025
…sabled deletionAtBatchIndexLevelEnabled (apache#24406)

(cherry picked from commit 3bd70fd)
(cherry picked from commit e10fce8)
KannarFr pushed a commit to CleverCloud/pulsar that referenced this pull request Sep 22, 2025
walkinggo pushed a commit to walkinggo/pulsar that referenced this pull request Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants