visortelle opened a new issue, #21932:
URL: https://github.com/apache/pulsar/issues/21932

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) 
and found nothing similar.
   
   
   ### Version
   
   3.1.2 standalone
   
   ### Minimal reproduce step
   
   - Start a new Pulsar instance with the default configuration: `./bin/pulsar 
standalone`
   - Create a new partitioned topic: `pulsar-admin topics 
create-partitioned-topic -p 3 persistent://public/default/new`
   - Ensure the partitioned topic is created:
   
   ```
   $ pulsar-admin topics list-partitioned-topics public/default
   persistent://public/default/new
   ```
   
   - Ensure the topic partitions are created: 
   
   ```
   $ pulsar-admin topics list public/default
   persistent://public/default/new-partition-0
   persistent://public/default/new-partition-2
   persistent://public/default/new-partition-1
   ```
   
   - Ensure that you can get a topic policy value:
   
   ```
   $ pulsar-admin topics  get-max-subscriptions persistent://public/default/new
   null
   ```
   
   - Await for partitions list will become empty. If you run Pulsar with the 
default configuration, it would happen after a minute or a few:
   
   ```
   $ pulsar-admin topics list public/default
   <empty output here>
   ```
   
   - Try to the same topic policy value again:
   
   ```
   $ pulsar-admin topics get-max-subscriptions persistent://public/default/new
   Topic persistent://public/default/new not found
   
   Reason: Topic persistent://public/default/new not found
   ```
   
   - After producing a single message to the `persistent://public/default/new` 
you'll be able to get and set topic policies again.
   
   ### What did you expect to see?
   
   I expect to be able to set partitioned topic policies in case it has no 
active partitions.
   
   That seems reasonable that it's not allowed to set policies to specific 
partitions.
   
   ```
   $ topics set-max-subscriptions -m 5 
persistent://public/default/new-partition-0
   ...
   Not allowed to set/get topic policy for a partition
   
   Reason: Not allowed to set/get topic policy for a partition
   ```
   
   Therefore it's easy to conclude that policies are set to the partitioned 
topic, not its partitions.
   
   Therefore it's hard to understand why we can't get or set policies if there 
are no active partitions.
   
   In case it won't be fixed for any technical reasons, it would be good to 
have the documentation for this behavior.
   
   ### What did you see instead?
   
   I described it in the "Minimal reproduce step" section.
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to