GeezerVison is showing github.com — [fix][broker] Log replicated subscription update ack failures by Denovo1998 · Pull Request #26109 · apache/pulsar
Conversation
Denovo1998
commented
Jun 29, 2026
•
edited by merlimat
Loading
Uh oh!
There was an error while loading. Please reload this page.
Motivation
When a replicated subscription update marker arrives, ReplicatedSubscriptionsController cumulatively acks the subscription to the replicated position, but the returned future was ignored (and so was the createSubscription future when the subscription is missing). The only trace of a failure was a debug log in PersistentSubscription.AckCallback.markDeleteFailed, so at default log levels a subscription that fails to advance on this cluster left nothing in the logs.
The most common rejection, however, is harmless: the update's position is already behind the local mark-delete position because local consumers acknowledged further. The cursor rejects it with MarkDeletingMarkedPosition, which ManagedCursorImpl already treats as "not actually a problem". Logging that at WARN would add noise up to once per snapshot interval per subscription.
Modifications
- Observe the ack future on both paths (existing subscription and subscription created from the update) and the
createSubscription future.
- If the ack fails and the cursor's mark-delete position is already at or past the replicated position, log at debug.
- Otherwise log a WARN with the subscription, the position, the current mark-delete position and the exception message.
- No retry is added: the next update carries the latest cumulative position.
- Tests assert, through
TestLogAppender, that a real failure logs one WARN on both paths and that an update behind the mark-delete logs none.
Verifying this change
./gradlew :pulsar-broker:test --tests ReplicatedSubscriptionsControllerTest -PtestRetryCount=0
./gradlew quickCheck
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This change observes the future returned by replicated subscription update acknowledgements, so async ack failures are no longer silently dropped. On failure it logs the subscription name, target position, unwrapped exception, and topic context from the controller logger.
The tests cover both update paths now: when the subscription already exists, and when the subscription is created from the incoming replicated update before applying the ack.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…subscription_update_ack_failures
lhotari
changed the title
[fix][broker] Observe replicated subscription update ack failures
[fix][broker] Log replicated subscription update ack failures
Jul 26, 2026
A replicated subscription update whose position the local subscription has
already acknowledged past is rejected by the cursor (MarkDeletingMarkedPosition),
which ManagedCursorImpl itself treats as benign. Log that case at debug and keep
WARN, without a stack trace, for the other ack and subscription-create failures.
Replace the tests that checked the ack future was observed with tests that assert
the WARN is (or is not) logged.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
merlimat
merlimat approved these changes
+1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|