pulsar
pulsar copied to clipboard
[improve] clean the empty topicAuthenticationMap in zk when revoke permission
Motivation
Steps to reproduce:
- grant permission for role1 on topic "persistent://public/default/test"
- revoke permission for role1 on topic "persistent://public/default/test"
- zk remain empty record, as shown in the picture

Modifications
If the topic has no roles after revoke permission, remove topicKey from TopicAuthenticationMap
Verifying this change
- [x] Make sure that the change passes the CI checks.
This change is already covered by existing tests, such as PersistentTopicsTest.
Does this pull request potentially affect one of the following parts:
If yes was chosen, please highlight the changes
- Dependencies (does it add or upgrade a dependency): no
- The public API: no
- The schema: no
- The default values of configurations: no
- The wire protocol: no
- The rest endpoints: no
- The admin cli options: no
- Anything that affects deployment: no
Documentation
Check the box below or label this PR directly.
Need to update docs?
- [x]
doc-not-needed(Please explain why)
The change looks good, could you please help add a test for the new change?
Thanks for your review. I have added a test. PTAL
@TakaHiR07 Please rebase the master and resolve the conflict.
@TakaHiR07 Please provide a correct documentation label for your PR. Instructions see Pulsar Documentation Label Guide.
@TakaHiR07 Please provide a correct documentation label for your PR. Instructions see Pulsar Documentation Label Guide.
@TakaHiR07 Please rebase the master and resolve the conflict.
@Jason918 done.
/pulsarbot run-failure-checks
Link to https://github.com/apache/pulsar/pull/17393.
Hi @TakaHiR07 It looks like we got many conflicts when cherry-picking it to branch-2.9. Would you mind pushing a PR to branch-2.9? (To avoid cherry-picking involving bugs)