315157973 opened a new issue #9146:
URL: https://github.com/apache/pulsar/issues/9146


   **Describe the bug**
   Now when the namespace policy is empty, various results are returned, with 
the following results:
   1) return broker-level policy
   2) return 0
   3) return -1
   4) return null
   5) throws Exception
   
   
   Among them, case 1 and case 2 will cause some bugs:
   Case 1: The default value returned is wrong when the user does not set any 
value
   Case 2: 0 has a meaning of disabled, so when 0 is returned, we can't judge 
in code whether the policy is not set or disabled. So `disabled` at namespace 
level will not take effect.
   
   First of all, I think we should fix case1 and case2
   
   **To Reproduce**
   Steps to reproduce the behavior:
   case1:
   1. Create a namespace, but do not set any initial values
   2. call `admin.namespaces().getPersistence(namespace)`
   3. The default value returned is wrong
   
   case2:
   1. set namespace-level `max_producers_per_topic` to 0
   2. `disabled` will not take effect.
   
   **Expected behavior**
   case1: return null
   case2: `disabled` take effect
   


----------------------------------------------------------------
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.

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


Reply via email to