Skip to content

[fix][broker] Log replicated subscription update ack failures - #26109

Open
Denovo1998 wants to merge 3 commits into
apache:masterfrom
Denovo1998:observe_replicated_subscription_update_ack_failures
Open

[fix][broker] Log replicated subscription update ack failures#26109
Denovo1998 wants to merge 3 commits into
apache:masterfrom
Denovo1998:observe_replicated_subscription_update_ack_failures

Conversation

@Denovo1998

Copy link
Copy Markdown
Contributor

Motivation

When a replicated subscription update marker is received, the broker acknowledges the target subscription position asynchronously. The returned future was previously ignored, so failures from the ack path could be dropped without any logging or completion observation.

This makes replicated subscription state updates harder to diagnose when the local ack fails.

Modifications

  • Add a helper to acknowledge replicated subscription updates and observe the returned future.
  • Log replicated subscription update ack failures with the subscription name and position.
  • Use the same helper for both existing subscriptions and subscriptions created from incoming replicated updates.
  • Observe subscription creation failures in the create-subscription path.
  • Add a regression test that verifies the update ack future is observed.

Verifying this change

  • Make sure that the change passes the CI checks.

  • gradlew :pulsar-broker:test --tests org.apache.pulsar.broker.service.persistent.ReplicatedSubscriptionsControllerTest -PtestRetryCount=0`

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

@void-ptr974 void-ptr974 left a comment

Copy link
Copy Markdown
Contributor

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.

@lhotari lhotari added this to the 5.0.0-M2 milestone 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
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.

3 participants