poorbarcode opened a new pull request, #15932: URL: https://github.com/apache/pulsar/pull/15932
### Motivation When I use the Admin API to create a tenant, if the tenants are limited and I already have the max # of tenants, I get an error "412 Reached the max tenants [n] restriction." This is good, but if I'm trying to create a tenant that already exists, I get the same error. But, creating a tenant that already exists should be a no-op and would not actually push me over my limit. "409 Already exists" is a softer error than "412 Reached the max restriction." It might be a little cleaner if Pulsar checked if the tenant exists first, and returned that error, before throwing the 412 exception. Otherwise the responsibility to fetch the tenants and check if it already exists must be done by the user. *Explain here the context, and why you're making that change. What is the problem you're trying to solve.* ### Modifications Swap the execution order of duplicate validation and maximum validation ### Documentation - [ ] `doc-required` - [x] `doc-not-needed` - [ ] `doc` - [ ] `doc-complete` -- 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]
