nodece opened a new pull request, #25592:
URL: https://github.com/apache/pulsar/pull/25592
### Motivation
Pending acks cleanup was previously executed in the `readMoreEntries`
dispatch path. This introduces unnecessary per-dispatch overhead in a hot path
and also risks concurrent access to the same pending-ack entries from both
dispatch and ack threads.
In addition, ack-triggered mark-delete operations are very frequent and
should not carry extra cleanup work. Cleanup is only required when messages are
removed due to expiry, skip, or clear-backlog operations, where mark-delete
completion semantics are more appropriate.
### Modifications
- Removed pending-acks cleanup from `readMoreEntries` hot path in dispatcher.
- Introduced `prunePendingAcksUpToPosition()` hook in dispatcher.
- Moved cleanup logic to mark-delete completion callbacks for:
- message expiry
- skip entries
- clear backlog
- Explicitly excluded ack-triggered mark-delete paths due to high frequency.
- Updated `PendingAcksMap` to store `remainingUnacked` instead of batch size.
- Consumer now maintains and uses `remainingUnacked` directly for accurate
counter updates without relying on cursor state after mark-delete.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]