GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [fix][broker] Log replicated subscription update ack failures by Denovo1998 · Pull Request #26109 · apache/pulsar

Conversation

@Denovo1998

@Denovo1998 Denovo1998 commented Jun 29, 2026 •
edited by merlimat
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

All reactions
@Denovo1998
[fix][broker] Observe replicated subscription update ack failures
255353e
void-ptr974
void-ptr974 reviewed Jun 29, 2026
View reviewed changes
Comment thread ...main/java/org/apache/pulsar/broker/service/persistent/ReplicatedSubscriptionsController.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Denovo1998
add test for replication subscription update failure handling
45bde64
void-ptr974
void-ptr974 approved these changes Jul 1, 2026
View reviewed changes

@void-ptr974 void-ptr974 left a comment

Copy link
Copy Markdown
Contributor

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.

All reactions
@lhotari
Merge remote-tracking branch 'origin/master' into observe_replicated_…
591502d
…subscription_update_ack_failures
@lhotari lhotari added this to the 5.0.0-M2 milestone Jul 26, 2026
@lhotari lhotari added release/4.2.3 release/4.0.13 release/4.2.4 and removed release/4.2.3 labels Jul 26, 2026
@lhotari lhotari changed the title [fix][broker] Observe replicated subscription update ack failures [fix][broker] Log replicated subscription update ack failures Jul 26, 2026
@lhotari lhotari added release/4.2.5 release/4.0.14 and removed release/4.2.4 release/4.0.13 labels Jul 27, 2026
@lhotari lhotari modified the milestones: 5.0.0-M2, 5.0.0 Sep 12, 2026
@lhotari lhotari added release/4.0.15 release/4.2.6 and removed release/4.0.14 release/4.2.5 labels Oct 14, 2026
merlimat added 2 commits October 17, 2026 18:51
@merlimat
Merge remote-tracking branch 'apache/master' into mmerli/adopt-26109-…
c6dd3f9
…repl-sub-update-ack
@merlimat
Don't warn on replicated updates behind the local mark-delete position
3be485d
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.
@merlimat merlimat modified the milestones: 5.0.0, 5.1.0 Oct 18, 2026
merlimat
merlimat approved these changes Oct 18, 2026
View reviewed changes
@merlimat
merlimat merged commit eea0e7c into apache:master Oct 18, 2026
44 checks passed

Uh oh!

There was an error while loading. Please reload this page.

lhotari added a commit that referenced this pull request Oct 18, 2026
@Denovo1998 @lhotari @merlimat
[fix][broker] Log replicated subscription update ack failures (#26109)
9e46fb9
Co-authored-by: Lari Hotari <[email protected]>
Co-authored-by: Matteo Merli <[email protected]>
(cherry picked from commit eea0e7c)
@lhotari lhotari added release/5.0.1 cherry-picked/branch-5.0 labels Oct 18, 2026
@lhotari lhotari removed release/4.2.6 release/4.0.15 labels Oct 20, 2026
@kaminski-dev kaminski-dev mentioned this pull request Oct 21, 2026
[Bug] A replicated __compaction subscription stops geo-replication (IllegalArgumentException in PulsarCompactorSubscription.acknowledgeMessage) #27031
Closed
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@merlimat merlimat merlimat approved these changes
+1 more reviewer
@void-ptr974 void-ptr974 void-ptr974 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cherry-picked/branch-5.0 release/5.0.1

Projects

None yet

Milestone

5.1.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@Denovo1998 @merlimat @void-ptr974 @lhotari
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.