You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "nodece (via GitHub)" <gi...@apache.org> on 2026/04/15 13:53:28 UTC
[PR] [fix][broker] Defer ack state updates until persistence succeeds [pulsar]
nodece opened a new pull request, #25528:
URL: https://github.com/apache/pulsar/pull/25528
#### Motivation
The broker ack path could update in-memory consumer ack state before the underlying subscription ack completed successfully. That makes ack failures harder to reason about and can lead to inconsistent broker-side state, especially when ack receipts are expected to reflect durable success.
#### Changes
- add an async-first subscription ack API and route broker ack handling through it
- defer broker-side ack memory updates in `Consumer` until the ack operation succeeds while keeping the existing helper-based logic shape close to the original code
- propagate persisted ack waiting from `ServerCnx` for request-id based ack receipts
- update persistent, non-persistent, replicated, dispatcher, pending-ack, and compactor subscription paths to use the async ack API
- adjust broker tests and fix `PersistentTopicTest#testCompactorSubscription` mock setup for the compactor ledger context
--
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][broker] Defer ack state updates until persistence succeeds [pulsar]
Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece commented on PR #25528:
URL: https://github.com/apache/pulsar/pull/25528#issuecomment-5577825959
@lhotari No. I will make an issue to track this known limitation.
--
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][broker] Defer ack state updates until persistence succeeds [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #25528:
URL: https://github.com/apache/pulsar/pull/25528#issuecomment-5573609959
> **Known limitation**: When a transaction is aborted, the consumer's unacked message count is not restored to its pre-ack value. This is a pre-existing issue unrelated to this refactoring and will be addressed in a follow-up PR.
@nodece Is there a follow-up PR for this known limitation?
--
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][broker] Defer ack state updates until persistence succeeds [pulsar]
Posted by "codelipenghui (via GitHub)" <gi...@apache.org>.
codelipenghui commented on PR #25528:
URL: https://github.com/apache/pulsar/pull/25528#issuecomment-4257194392
Will the broker stop dispatch messages to the consumer if the consumer has been set to a lower max unack message and the persistence interval of the cursor set to a higher value?
--
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][broker] Defer ack state updates until persistence succeeds [pulsar]
Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece commented on PR #25528:
URL: https://github.com/apache/pulsar/pull/25528#issuecomment-4257424554
@codelipenghui
The broker should not stop dispatching messages just because `managedLedgerCursorPositionFlushSeconds` is higher.
In this implementation, `unackedMessages` is decremented when `acknowledgeMessageAsync(...)` completes, and that completion is driven by the managed cursor ack callback path, not by the periodic cursor flush task itself.
For the normal path, the ack immediately triggers async mark-delete/delete persistence, so it does not wait for `managedLedgerCursorPositionFlushSeconds`.
`managedLedgerCursorPositionFlushSeconds` is only a fallback for dirty/rate-limited cursor updates. In that case the cursor callback is completed immediately and the actual flush is deferred, so dispatch is not blocked waiting for that interval either.
--
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][broker] Defer ack state updates until persistence succeeds [pulsar]
Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece merged PR #25528:
URL: https://github.com/apache/pulsar/pull/25528
--
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