-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix using partitioned topic name to get Policy #11294
Merged
Merged
Conversation
This file contains 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
eolivelli
approved these changes
Jul 13, 2021
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
I left a couple of minor comments
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicPoliciesTest.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicPoliciesTest.java
Outdated
Show resolved
Hide resolved
hangc0276
approved these changes
Jul 13, 2021
sijie
added
component/topic-policy
type/bug
The PR fixed a bug or issue reported a bug
labels
Jul 14, 2021
sijie
approved these changes
Jul 14, 2021
codelipenghui
pushed a commit
that referenced
this pull request
Sep 2, 2021
### Motivation In the master branch, the REST API no longer allows the topic name of the partition to be used to set the topic policy, but there are still many places where it will be used internally. Suppose we set a Topic policy for `persistent://tenant/namespace/topic` However, the policy cannot be obtained through `persistent://tenant/namespace/topic-partition-0`, which causes the policy to become invalid. For example:PersistentTopic.checkSubscriptionTypesEnable ### Modifications Convert the name in SystemTopicBasedTopicPoliciesService (cherry picked from commit 35d29b9)
codelipenghui
added a commit
that referenced
this pull request
Sep 2, 2021
3 tasks
codelipenghui
pushed a commit
that referenced
this pull request
Sep 6, 2021
…licies (#11897) ### Motivation There is a bug that using the partitioned topic name to get topic policies. The PR #11294 fix this issue, but it's hard to cherry-pick the PR to `branch-2.7`, so create this PR to fix the issue in `branch-2.7`. This PR contains [PR-11294](#11294) and [PR-11863](#11863). ### Modifications 1. Fix using the partitioned topic name to get topic policies. 2. Change some warning logs to debug level for the getting topic policies operation. ### Verifying this change The test method `TopicPoliciesTest#testBacklogQuotaWithPartitionedTopic` is used to verify getting topic policies by the partitioned topic name.
bharanic-dev
pushed a commit
to bharanic-dev/pulsar
that referenced
this pull request
Mar 18, 2022
### Motivation In the master branch, the REST API no longer allows the topic name of the partition to be used to set the topic policy, but there are still many places where it will be used internally. Suppose we set a Topic policy for `persistent://tenant/namespace/topic` However, the policy cannot be obtained through `persistent://tenant/namespace/topic-partition-0`, which causes the policy to become invalid. For example:PersistentTopic.checkSubscriptionTypesEnable ### Modifications Convert the name in SystemTopicBasedTopicPoliciesService
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cherry-picked/branch-2.7
Archived: 2.7 is end of life
cherry-picked/branch-2.8
Archived: 2.8 is end of life
doc-not-needed
Your PR changes do not impact docs
release/2.7.4
release/2.8.1
type/bug
The PR fixed a bug or issue reported a bug
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.
Motivation
In the master branch, the REST API no longer allows the topic name of the partition to be used to set the topic policy, but there are still many places where it will be used internally.
Suppose we set a Topic policy for
persistent://tenant/namespace/topic
However, the policy cannot be obtained through
persistent://tenant/namespace/topic-partition-0
, which causes the policy to become invalid.For example:PersistentTopic.checkSubscriptionTypesEnable
Modifications
Convert the name in SystemTopicBasedTopicPoliciesService
Verifying this change