-
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
Support get topic applied policy #9216
Comments
I will work on it |
Master Issue: #9216 ### Motivation Provide a way to get the applied policy of the topic. In Pulsar, the topic will apply the topic level policy if present or apply the namespace policy if present or use the broker level configuration. It needs to support get the applied policy for a topic that might use the namespace policy or topic policy or broker level default configuration. ### Modifications 1 Now if there is no data at the namespace-level, the broker-level data will be returned by default, so I fix it 2 Now if there is no data at the topic-level, the data at the namespace-level will be returned by default, so I fix it 3 Add applied interface 4 Since the initial value becomes null, the corresponding unit test is modified
Master Issue: #9216 ### Modifications 1 Now if there is no data at the namespace-level, the broker-level data will be returned by default, so let it return null 2 add query param `applied` for getInactiveTopic 3 add `applied` API for client ### Verifying this change unit test: InactiveTopicDeleteTest#testInactiveTopicApplied
@315157973 thanks for your contribution. Could you please add doc once you finish all code work? |
OK |
Master Issue: #9216 ### Modifications add applied API ### Verifying this change Test whether the API works: testGetMaxProducerApplied
Master Issue: #9216 ### Modifications add applied API for client ### Verifying this change unit test: adminApiDelayedDelivery.testNamespaceDelayedDeliveryPolicyApi adminApiDelayedDelivery.testDelayedDeliveryApplied
Master Issue: #9216 ### Modifications add applied API ### Verifying this change Test whether the API works: testGetMaxConsumersApplied
Master Issue: #9216 ### Modifications 1. Add applied API 2. Add remove API ### Verifying this change 1. Test whether the priority is correct when policies of different levels exist at the same time 2. Test applied API works
Master Issue: #9216 ### Modifications Add applied API for offloadPolicies
@315157973 @codelipenghui will these code changes apply to 2.7.1? |
Master Issue: #9216 ### Modifications 1) The api name of topic-level is consistent with that of namespace-level 2) Fix the problem that the namespace-level policy cannot be removed 3) Fix the problem that topic-level does not take effect when multiple levels of policy are set at the same time 4) Added applied API ### Verifying this change Verify that the new API is correct Verify that the applied API is correct Verify that policies of different levels exist at the same time and whether the priority is correct
@Anonymitaet No, this will available in 2.8.0 |
I will fix thread safety issues in a unified way,will not affect this issue |
@315157973 that would be very good. How? |
#9290) Master Issue: #9216 ### Modifications 1) Fix the unackedMessagesExceededOnSubscription at the namespace level cannot be disabled 2) Added applied interface ### Verifying this change test applied api : testMaxUnackedMessagesOnSubApplied test priority : testMaxUnackedMessagesOnSubscriptionPriority
Master Issue: #9216 ### Modifications Add applied API and fix default value in unit test ### Verifying this change Verify the applied API and CMD Verify the default value in namespace-level
Master Issue: #9216 ### Modifications 1. Add applied API for topic policies 2. Add remove API for namespace policies ### Verifying this change testGetSubDispatchRateApplied
I have added a comment here: https://github.com/apache/pulsar/pull/9832/files#r589192556 @codelipenghui The thread safety issue isn't related to Zookeeper. It's mainly about unsafe mutation and access of HashMaps. The reason why I think #9711 should be addressed first is that more thread safety issues are introduced in the code base in the PRs related to this issue. The above example is such. |
Master Issue: #9216 ### Modifications 1. Add applied API for ReplicatorDispatchRate in topic-level 2. Add remove for ReplicatorDispatchRate in namespace-level ### Verifying this change Verify the applied API and CMD
@lhotari Thanks for the clarification. I don't think it should block the new feature implement. I understand your concern, if we merge more PRs related to the policies, we need to do more changes when fixing #9711. But for community cooperation, we should not block the new features. #9216 is planned to release in 2.8.0. So we can confirm before release 2.8.0, #9711 can be fixed, is this works for you? |
@codelipenghui Makes sense. Fixing #9711 might have broader impacts and dealing with it asap would be important. I hope it gets prioritized since it seems that the issue is cross-cutting and the current unsafe pattern is copied over to new feature development like we have seen in this case. |
Master Issue: #9216 ### Modifications Add applied API for topic-level Add remove API for namespace-level ### Verifying this change Verify the applied API and CMD
Master Issue: #9216 ### Modifications 1. Add applied API for topic-level 2. Add remove for namespace-level ### Verifying this change Verify applied API and CMD
Master Issue: #9216 ### Modifications 1. Add applied API for topic policies 2. Add remove API for namespace policies
@315157973 thanks for your great contribution! Since you've finished all code work, could u pls add docs for them? Then users know your changes and how to use it. I think the descriptions should be added to pulsar-admin, REST API, or Java admin API if needed. Feel free to ping me if you need doc review. After doc is added, we can close this issue. |
There are descriptions in my code, and we already have automatic document generation tools, so I don’t need to add them manually, right? @Anonymitaet |
@315157973 yes, the "docs" are added in the code files and they will be shown on websites automatically. One thing should pay attention to is that if your changes apply to pulsar-admin, REST API, and Java admin API, make sure the "docs" are added there. Do your changes apply to these 3 websites? |
"docs" are added in |
@315157973 |
All of my new APIs have descriptions. However, my new APIs and many old APIs with descriptions are not displayed in pulsar/pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Topics.java Lines 1660 to 1674 in 56bad04
This API has been around for a long time, but it does not appear in the |
I've checked all commands and documented details here. I found that all commands (except |
Hi @tuteng @315157973 has added various commands and docs correspondingly in their source code files. Docs for pulsar-admin and REST API are shown on websites but docs for Java Admin API are not shown on any version of the Java Admin API website (https://pulsar.apache.org/api/admin/2.7.0-SNAPSHOT/ or https://pulsar.apache.org/api/admin/). Do you have any clues? Many thanks. |
Hi @tuteng could u pls give us some instructions? Many thanks. |
@315157973 the docs you added for Java Admin API should be shown on https://pulsar.apache.org/api/admin/2.8.0-SNAPSHOT/, however, currently https://pulsar.apache.org/api/admin/2.8.0-SNAPSHOT/ is not generated yet and it should be generated after 2.7.1 is released. I've discussed w/ @tuteng and opened this issue to track. He will handle it. Since code work has been finished and all docs have been added to source code files (pulsar-admin, REST API, and Java admin API), I'll close this issue and keep an eye for the commands that should be shown on https://pulsar.apache.org/api/admin/2.8.0-SNAPSHOT/ once https://pulsar.apache.org/api/admin/2.8.0-SNAPSHOT/ is generated. |
Master Issue: apache#9216 Provide a way to get the applied policy of the topic. In Pulsar, the topic will apply the topic level policy if present or apply the namespace policy if present or use the broker level configuration. It needs to support get the applied policy for a topic that might use the namespace policy or topic policy or broker level default configuration. 1 Now if there is no data at the namespace-level, the broker-level data will be returned by default, so I fix it 2 Now if there is no data at the topic-level, the data at the namespace-level will be returned by default, so I fix it 3 Add applied interface 4 Since the initial value becomes null, the corresponding unit test is modified (cherry picked from commit 54b083b)
Is your feature request related to a problem? Please describe.
Provide a way to get the applied policy of the topic. In Pulsar, the topic will apply the topic level policy if present or apply the namespace policy if present or use the broker level configuration. It needs to support get the applied policy for a topic that might use the namespace policy or topic policy or broker level default configuration.
Describe the solution you'd like
Add "--applied" for the get policy cmd. For example:
The text was updated successfully, but these errors were encountered: