pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[improve] clean the empty topicAuthenticationMap in zk when revoke permission

Open TakaHiR07 opened this issue 3 years ago • 1 comments

Motivation

Steps to reproduce:

  1. grant permission for role1 on topic "persistent://public/default/test"
  2. revoke permission for role1 on topic "persistent://public/default/test"
  3. zk remain empty record, as shown in the picture

企业微信截图_2725005a-a13e-4f07-b27a-112986e1b856

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)

TakaHiR07 avatar Jul 27 '22 08:07 TakaHiR07

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 avatar Aug 08 '22 12:08 TakaHiR07

@TakaHiR07 Please rebase the master and resolve the conflict.

Jason918 avatar Aug 27 '22 08:08 Jason918

@TakaHiR07 Please provide a correct documentation label for your PR. Instructions see Pulsar Documentation Label Guide.

github-actions[bot] avatar Aug 27 '22 08:08 github-actions[bot]

@TakaHiR07 Please provide a correct documentation label for your PR. Instructions see Pulsar Documentation Label Guide.

github-actions[bot] avatar Aug 27 '22 08:08 github-actions[bot]

@TakaHiR07 Please rebase the master and resolve the conflict.

@Jason918 done.

TakaHiR07 avatar Aug 30 '22 07:08 TakaHiR07

/pulsarbot run-failure-checks

TakaHiR07 avatar Sep 02 '22 08:09 TakaHiR07

Link to https://github.com/apache/pulsar/pull/17393.

nodece avatar Sep 05 '22 02:09 nodece

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)

mattisonchao avatar Sep 13 '22 02:09 mattisonchao