poorbarcode opened a new pull request, #19879: URL: https://github.com/apache/pulsar/pull/19879
### Motivation As expected, If geo-replication is enabled, a topic cannot be deleted. However deleting that topic returns a 500, and no further info. ``` 2023-03-21T18:09:57,909 - INFO - [pulsar-web-75-16:Slf4jRequestLogWriter@62] - 127.0.0.1 - - [21/3月/2023:18:09:57 +0800] "DELETE /admin/v2/persistent/pulsar/ns/tp_e82c0505-d47f-4e4a-8a62-9fa8d6341b76-d6d75112-fbe3-419d-a2d4-2186707185db?force=false&deleteSchema=true HTTP/1.1" 500 6641 "-" "Pulsar-Java-v3.0.0-SNAPSHOT" 11 ``` In this case, we should give an error of 400 instead of 500. ### Modifications Make response code to 400 instead of 500 when delete topic fails due to enabled geo-replication ``` 2023-03-21T18:13:10,840 - WARN - [AsyncHttpClient-236-1:BaseResource$4@236] - [http://localhost:64881/admin/v2/persistent/pulsar/ns/tp_630d809a-6874-4c1b-99ad-5f5e0147950a-ed229063-2805-4ca6-abfb-b9685a4b93f3?force=false&deleteSchema=true] Failed to perform http delete request: javax.ws.rs.BadRequestException: HTTP 400 {"reason":"Delete forbidden topic is replicated on clusters [r2, r3]"} ``` ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> ### Matching PR in forked repository PR in forked repository: - https://github.com/poorbarcode/pulsar/pull/80 -- 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: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org