[fix][broker] Prevent partition expansion from inheriting delayed-delivery bucket state#26179
Open
void-ptr974 wants to merge 1 commit into
Open
Conversation
…ivery bucket state
3613eb5 to
6fc0a4b
Compare
Denovo1998
reviewed
Jul 12, 2026
Comment on lines
+464
to
+466
| Map<String, String> subscriptionProperties = | ||
| filterSubscriptionPropertiesForPartitionExpansion( | ||
| entry.getValue().getSubscriptionProperties()); |
Contributor
There was a problem hiding this comment.
Filtering here addresses partition expansion, but since #26159, the Admin getSubscriptionProperties endpoint returns raw cursor properties, including #pulsar.internal.*, while updateSubscriptionProperties delegates to ManagedCursorImpl#setCursorProperties, which rejects maps containing that prefix. Consequently, a GET → modify → PUT cycle can fail once bucket state exists. Should we note a follow-up to restore the user/internal property boundary for instance, by exposing filtered user properties through the Admin API while keeping raw cursor properties accessible only to broker internals?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #26178
Motivation
When increasing partitions, Pulsar copies durable subscription properties from
partition-0 to new partitions.
Bucket delayed delivery stores cursor-local snapshot metadata as
#pulsar.internal.delayed.bucket*. Copying that state makes a new partitionrecover delayed-message indexes that belong to partition-0, which can result in
incorrect delayed-delivery state and invalid replay attempts.
Modifications
Filter
#pulsar.internal.*properties before creating subscriptions on newpartitions. User-defined subscription properties are still copied.
Existing cursor-property and stats exposure is unchanged.
Verifying this change
tracker and verifies it recovers zero delayed messages.
./gradlew --no-daemon --console=plain :pulsar-broker:test --tests org.apache.pulsar.broker.admin.IncrementPartitionsTest --tests org.apache.pulsar.broker.service.persistent.BucketDelayedDeliveryTest./gradlew --no-daemon --console=plain :pulsar-broker:checkstyleMain :pulsar-broker:checkstyleTestDoes this pull request potentially affect one of the following parts: