shibd commented on pull request #13337:
URL: https://github.com/apache/pulsar/pull/13337#issuecomment-995578523


   This should not skip the system topic check here, I test it. There maybe 
problems.
   
   1. Deleting a namespace may return 500
   ```
   ➜  bin git:(master) ✗ ./pulsar-admin namespaces delete sample/ns1
   2021-12-16T16:51:07,550+0800 [AsyncHttpClient-7-1] WARN  
org.apache.pulsar.client.admin.internal.BaseResource - 
[http://localhost:8080/admin/v2/namespaces/sample/ns1?force=false] Failed to 
perform http delete request: javax.ws.rs.InternalServerErrorException: HTTP 500 
Internal Server Error
   HTTP 500 Internal Server Error
   ```
   
   2. Can still find the namespace after deleting it
   ```
   ➜  bin git:(master) ✗ ./pulsar-admin topics list sample/ns1
   persistent://sample/ns1/__change_events
   ```
   
   3. Broker maybe print error log
   ```
   2021-12-16T16:49:04,065+0800 [pulsar-io-18-23] WARN  
org.apache.pulsar.broker.web.PulsarWebResource - Policies not found for 
sample/ns1 namespace
   2021-12-16T16:49:04,065+0800 [pulsar-io-18-23] WARN  
org.apache.pulsar.broker.service.ServerCnx - Failed to get Partitioned Metadata 
[/127.0.0.1:56739] persistent://sample/ns1/__change_events: Policies not found 
for sample/ns1 namespace
   org.apache.pulsar.broker.web.RestException: Policies not found for 
sample/ns1 namespace
        at 
org.apache.pulsar.broker.web.PulsarWebResource.lambda$checkLocalOrGetPeerReplicationCluster$12(PulsarWebResource.java:774)
 ~[classes/:?]
        at 
java.util.concurrent.CompletableFuture.uniAcceptNow(CompletableFuture.java:753) 
~[?:?]
        at 
java.util.concurrent.CompletableFuture.uniAcceptStage(CompletableFuture.java:731)
 ~[?:?]
        at 
java.util.concurrent.CompletableFuture.thenAccept(CompletableFuture.java:2108) 
~[?:?]
        at 
org.apache.pulsar.broker.web.PulsarWebResource.checkLocalOrGetPeerReplicationCluster(PulsarWebResource.java:745)
 ~[classes/:?]
   ```
   
   I debugged the code.
   
   In fact, an try to delete the system topic when deleting the namespace. 
   
   
https://github.com/apache/pulsar/blob/ae2f1050cc65d19aa5367c45f71aaa43efc5af16/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java#L270
   
   But Internal consumers and producers will reconnect, resulting in the auto 
create of the topic.
   
   Should we shut down these internal consumers(and producers) first? Ensure 
that the system topic is deleted correctly before deleting the bundle?
   
   Or directly redirect `deletenamespacebundleforcefully` method 
https://github.com/apache/pulsar/issues/10263#issuecomment-992098097
   
   For your reference, If there is a problem, we can continue to discuss it, 
thanks.
   


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