-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 topic ownership is not checked #9767
Conversation
@315157973 can you please add tests that cover your fix ? You are removing the assertions from PersistentTopicBase. |
I will add unit tests later. Topic policies currently only exist on V2,so are those assertions |
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.
Thanks @315157973 , Could you please add a multiple brokers test case since the problem can't reproduce on a single broker cluster. We need to ensure no matter the admin to call which broker of the cluster, it can get the correct policy data. So my suggestion is to check the returned policy multiple times for different brokers.
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Outdated
Show resolved
Hide resolved
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.
+1
@315157973 thanks for your clarification
…ch-2.7) (#9781) ### Motivation 1. Currently, the API of topic policies does not check the ownership of topic. In the case of multiple brokers, a `cache not init error` will appear. 2. The parameter validation of the read and write API should not be the same, and the read API should not verify `validatePoliciesReadOnlyAccess()`. If `ReadOnly` is set, the read API will also be abnormal. 3. General API should not use `validateAdminAccessForTenant()`. The original PR is #9767
…ch-2.7) (apache#9781) ### Motivation 1. Currently, the API of topic policies does not check the ownership of topic. In the case of multiple brokers, a `cache not init error` will appear. 2. The parameter validation of the read and write API should not be the same, and the read API should not verify `validatePoliciesReadOnlyAccess()`. If `ReadOnly` is set, the read API will also be abnormal. 3. General API should not use `validateAdminAccessForTenant()`. The original PR is apache#9767
### Motivation 1. Currently, the API of topic policies does not check the ownership of topic. In the case of multiple brokers, a `cache not init error` will appear.
Motivation
Currently, the API of topic policies does not check the ownership of topic. In the case of multiple brokers, a
cache not init error
will appear.The parameter validation of the read and write API should not be the same, and the read API should not verify
validatePoliciesReadOnlyAccess()
. IfReadOnly
is set, the read API will also be abnormal.General API should not use
validateAdminAccessForTenant()
.