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] Reject replicated status for the compaction subscription by kaminski-dev · Pull Request #27037 · apache/pulsar

Conversation

@kaminski-dev

@kaminski-dev kaminski-dev commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Main Issue: #27031

Motivation

This is the follow-up to #27032, as requested in #27031 (comment).

#27032 makes the receiving cluster ignore REPLICATED_SUBSCRIPTION_UPDATE markers for __compaction. But a cluster still accepts the replicated status for __compaction, through pulsar-admin topics set-replicated-subscription-status or a consumer that subscribes with replicateSubscriptionState=true. It then keeps creating snapshots and sending update markers for a cursor that only the local compactor may move.

Modifications

  • Override setReplicated in PulsarCompactorSubscription:
    • setReplicated(true) returns false and changes nothing. The admin API already checks this return value (PersistentTopicsBase.internalSetReplicatedSubscriptionStatusForNonPartitionedTopic), so enabling the status for __compaction now fails. The subscribe path ignores the return value, so a consumer that subscribes with replicateSubscriptionState=true no longer turns it on.
    • setReplicated(false) is still delegated to PersistentSubscription. The parent constructor calls it for every PulsarCompactorSubscription, so a replicated status that was stored on the cursor before this fix is still removed when the topic is loaded, and set-replicated-subscription-status --disable keeps working for clusters that already have the status set.

Note: the admin API answers a rejected setReplicated(true) with 500 Failed to update cursor properties. This PR keeps that response. If a 4xx with a clearer message is preferred, I can add a check for the compaction subscription in PersistentTopicsBase.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • PersistentTopicTest.testCompactorSubscriptionCannotBeReplicated: setReplicated(true) returns false, isReplicated() stays false and the cursor property is not written; setReplicated(false) still succeeds. Without the fix, setReplicated(true) returns true.

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

REST endpoints: POST .../subscription/{subName}/replicatedSubscriptionStatus with true now fails for __compaction instead of enabling it.

Sorry, something went wrong.

Uh oh!

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

All reactions
@kaminski-dev
[fix][broker] Reject replicated status for the compaction subscription
350c180
`__compaction` can be marked as replicated through the admin API or
`replicateSubscriptionState=true`. The cluster then sends replicated
subscription update markers for it, which a remote cluster cannot apply
to its compactor cursor.

Override PulsarCompactorSubscription.setReplicated so that enabling
returns false and changes nothing. Disabling is still delegated, so a
replicated status that was set before can be removed.

Assisted-by: Claude Code (claude-opus-5-5)
@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
codelipenghui
codelipenghui approved these changes Oct 21, 2026
View reviewed changes

@codelipenghui codelipenghui 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.

Reviewed head 350c180. No actionable findings identified within the reviewed scope.

The override rejects enabling replication without mutating state while preserving disabling and constructor-time cleanup. Three focused compactor tests passed. The new regression test failed as expected with the override removed and passed again after restoration.

Sorry, something went wrong.

Uh oh!

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

All reactions
@codelipenghui codelipenghui added this to the 5.1.0 milestone Oct 21, 2026
@codelipenghui codelipenghui assigned kaminski-dev Oct 21, 2026
lhotari
lhotari approved these changes Oct 22, 2026
View reviewed changes

@lhotari lhotari left a comment

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

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

All reactions
@lhotari lhotari added release/4.2.6 release/4.0.15 labels Oct 22, 2026
@lhotari
lhotari merged commit 59014f9 into apache:master Oct 22, 2026
44 checks passed

Uh oh!

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

@kaminski-dev

kaminski-dev commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

@lhotari Thanks for merging! #27032 has the release/5.0.1 label and is already cherry-picked to branch-5.0, but this PR only has release/4.0.15 and release/4.2.6. Should it also get release/5.0.1, so that 5.0.x rejects the replicated status for __compaction like 4.0.x and 4.2.x?

All reactions

Sorry, something went wrong.

Uh oh!

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

@kaminski-dev
kaminski-dev deleted the fix/reject-replicated-status-for-compaction-sub branch October 22, 2026 11:23
lhotari pushed a commit that referenced this pull request Oct 22, 2026
@kaminski-dev @lhotari
[fix][broker] Reject replicated status for the compaction subscription (
b439c2d
#27037)

(cherry picked from commit 59014f9)
@lhotari lhotari added release/5.0.1 cherry-picked/branch-5.0 labels Oct 22, 2026
@lhotari

lhotari commented Oct 22, 2026

Copy link
Copy Markdown
Member

@lhotari Thanks for merging! #27032 has the release/5.0.1 label and is already cherry-picked to branch-5.0, but this PR only has release/4.0.15 and release/4.2.6. Should it also get release/5.0.1, so that 5.0.x rejects the replicated status for __compaction like 4.0.x and 4.2.x?

@kaminski-dev Yes, 5.0.1 is covered. I'm currently using a strategy to cherry-pick all changes made in master branch to branch-5.0 unless there's a skip-cherry-pick label.

kaminski-dev reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

This was referenced Nov 21, 2026
[improve][ci] Run CI for the 4.2.6 backports to branch-4.2 (do not merge) #27680
Closed
[improve][ci] Run CI for the 4.2.6 backports to branch-4.2 (do not merge) #27681
Closed
[improve][ci] Run CI for the 4.2.6 backports to branch-4.2 (do not merge) #27684
Closed
@lhotari lhotari added cherry-picked/branch-4.2 cherry-picked/branch-4.0 labels Nov 21, 2026
poorbarcode pushed a commit to poorbarcode/pulsar that referenced this pull request Nov 26, 2026
@kaminski-dev @lhotari
[fix][broker] Reject replicated status for the compaction subscription (
51acf7f
apache#27037)

(cherry picked from commit 59014f9)
poorbarcode pushed a commit to poorbarcode/pulsar that referenced this pull request Nov 26, 2026
@kaminski-dev @lhotari
[fix][broker] Reject replicated status for the compaction subscription (
641fd72
apache#27037)

(cherry picked from commit 59014f9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lhotari lhotari lhotari approved these changes
@codelipenghui codelipenghui codelipenghui approved these changes

Uh oh!

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

Assignees

@kaminski-dev kaminski-dev

Labels

cherry-picked/branch-4.0 cherry-picked/branch-4.2 cherry-picked/branch-5.0 release/4.0.15 release/4.2.6 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.

3 participants

@kaminski-dev @lhotari @codelipenghui
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.