poorbarcode opened a new pull request, #17070:
URL: https://github.com/apache/pulsar/pull/17070

   Fixes #17050
   
   Master Issue:
   -  #17050
   
   ### Motivation
   
   If enabled system topic, when a topic is deleted, these events are triggered 
serially:
   
   - delete topic
   - check topic ownership
   - load bundle
   - trigger event: NamespaceBundleOwnershipListener.onLoad()
   - init system topic client
   - subscribe system topic
   - (<strong>High loght</strong>)create topic: __change_events
   
   Then the exception "Directory not empty" occurs when deleting the namespace.
   
   
https://github.com/apache/pulsar/blob/ee0ea3a6f9ffb42d4ec129eb689d3c1059e5f4a8/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApi2Test.java#L1367-L1371
   
   Even if will try to delete topics that type `system` when deleting 
namespace, there is still the problem of multi-thread concurrency.
   
   
https://github.com/apache/pulsar/blob/ee0ea3a6f9ffb42d4ec129eb689d3c1059e5f4a8/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java#L311-L315
   
   #### (<strong>High light</strong>) I think this is also a bug
   when the user manually creates the topic but does not use it, and then 
quickly deletes the namespace, there is a small probability left topic 
`__change_events`
   
   ### Modifications
   
   - This PR only fixed the flaky test: Delete namespace after 
`__change_events` is successfully created.
   
   - As for how to solve the bug, I think we need to discuss
   
   ### Documentation
   
   - [ ] `doc-required` 
   (Your PR needs to update docs and you will update later)
     
   - [x] `doc-not-needed` 
   (Please explain why)
     
   - [ ] `doc` 
   (Your PR contains doc changes)
   
   - [ ] `doc-complete`
   (Docs have been already added)


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