[fix][broker] Fix namespace deletion if __change_events topic has not been created yet - #18804
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18804 +/- ##
=============================================
- Coverage 50.05% 34.23% -15.83%
+ Complexity 11024 6518 -4506
=============================================
Files 703 623 -80
Lines 68814 59090 -9724
Branches 7378 6145 -1233
=============================================
- Hits 34446 20227 -14219
- Misses 30621 36194 +5573
+ Partials 3747 2669 -1078
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
gaoran10
left a comment
There was a problem hiding this comment.
I'm not sure we need to handle the warning, it's expected behavior.
| String namespace = tenant + "/test-ns2"; | ||
| admin.namespaces().createNamespace(namespace, Set.of("test")); | ||
| admin.topics().createNonPartitionedTopic(namespace + "/tobedeleted"); | ||
| // verify namespace can be deleted even without topic policy events |
There was a problem hiding this comment.
I'm not sure why the namespace couldn't be deleted when there is no topic policy events.
There was a problem hiding this comment.
it's the scope of this pull 😁
When deleting namespace with force=true, you first delete the topics in it. For each topics deleted, a new event is generated. However if the __change_events doesn't exist yet, it's auto-created. But the creation fails since the namespace is being deleted.
There was a problem hiding this comment.
btw I've added a more specific unit test case
|
@gaoran10 @Technoboy- PTAL |
… been created yet (apache#18804)
… been created yet (#18804)
Fixes #18802
Motivation
Sending the event to the __change_events topic is useless if the namespace is deleted (or in the process of).
Also during the namespace deletion procedure, it's not possible to create new topics so if it doesn't exist yet it throws an error.
Modifications
Verifying this change
Documentation
docdoc-requireddoc-not-neededdoc-complete