-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix][flaky-test]AdminApi2Test.testDeleteTenant #17070
Conversation
TreeSet<String> topics = new TreeSet<>(); | ||
topics.addAll(pulsar.getNamespaceService() | ||
.getListOfPersistentTopics(NamespaceName.get(namespace)).join()); | ||
topics.addAll(pulsar.getPulsarResources().getNamespaceResources().getPartitionedTopicResources() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think query getListOfPersistentTopics
is enough, because __change_events
is persistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And we don't need to check partitioned topics? Because we will eventually create the partitons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Technoboy-
I think query getListOfPersistentTopics is enough, because __change_events is persistent.
already remove the logic that queries non-persistent topic
And we don't need to check partitioned topics? Because we will eventually create the partitons.
already add the partitioned topics check.
Here looks like a race condition? The system topic created after the namespace has been deleted? |
both correct. |
When deleting the partitioned topics, we have to check the ownership first and find that the bundle is not owned and then try to own the bundle and then trigger the system topic created async. |
I try to fix the flaky test this way: make delete namespace after @Technoboy- @codelipenghui Could you review this PR again? |
I come up with a new idea for deleting partitioned topics, we can set the LookupOptions.readOnly(true) when |
342d935
to
1272533
Compare
(cherry picked from commit 89e82a2)
Fixes #17050
Master Issue:
Motivation
If enabled system topic, when a topic is deleted, these events are triggered serially:
Then the exception "Directory not empty" occurs when deleting the namespace.
pulsar/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApi2Test.java
Lines 1367 to 1371 in ee0ea3a
Even if will try to delete topics that type
system
when deleting namespace, there is still the problem of multi-thread concurrency.pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
Lines 311 to 315 in ee0ea3a
(High light) 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
I try to fix the flaky test this way: make delete namespace after __change_events is successfully created, but there still has another race condition: the
__change_events/__compaction
async creates and__change_events
delete by namespace delete. Therefore, I will disabled systemTopic in methodtestDeleteTenant
to solve this flaky test.Modifications
This PR only fixed the flaky test: disabled systemTopic in method
testDeleteTenant
.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)
doc-not-needed
(Please explain why)
doc
(Your PR contains doc changes)
doc-complete
(Docs have been already added)