Skip to content

Failed to produce/consumer partitioned topic if updated the topic partition number #10300

@dragonls

Description

@dragonls

Describe the bug
While using partitioned topic, if we control the authorization of the topic in topic level and update the topic partiton number, new producer/consumer will recerive auth error org.apache.pulsar.client.api.PulsarClientException$LookupException: Proxy Client is not authorized to Lookup

To Reproduce
Steps to reproduce the behavior:

  1. Having a pulsar cluster using JWT for authentication
  2. Create a partitionen topic persistent://test/auth/topic with 2 partitions: ./bin/pulsar-admin topics create-partitioned-topic -p 2 persistent://test/auth/topic
  3. Grant produce and consume permissions to role roleA: ./bin/pulsar-admin topics grant-permission --role roleA --actions produce,consume persistent://test/auth/topic
  4. Try produce and consume this topic using subscription roleA-test, shoule be normal till now
  5. Update the topic partition number: ./bin/pulsar-admin topics update-partitioned-topic -p 4 persistent://test/auth/topic
  6. Try to use role roleA to produce/consume the topic using subscription roleA-test again, we will get error:
    • produce get error: org.apache.pulsar.client.api.PulsarClientException$LookupException: Proxy Client is not authorized to Lookup
    • consume get error: org.apache.pulsar.client.api.PulsarClientException$LookupException: Failed to subscribe persistent://test/auth/topic with 4 partitions

Expected behavior
After updating the partitioned topic, new producer/consumer of this topic should not get error.

Additional context
I tried branch 2.7 and master, both having this bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugThe PR fixed a bug or issue reported a bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions