-
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
[Enhancement] avoid duplicate deletion of schema #11640
[Enhancement] avoid duplicate deletion of schema #11640
Conversation
I believe that this is a good idea. Can you please add a test case ? |
Nice catch! |
@hangc0276 thanks for triaging PR and issues. When you label PRs, if you find some PRs do not need to update doc, could you please help label the PR with |
@Anonymitaet Ok, I will add doc label in the following PRs, thank you! |
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.
Good work
Can you add a test case?
Sorry for the late reply! I will add a test later. |
/pulsarbot run-failure-checks |
2 similar comments
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
…_duplicate_deletion_of_schema
/pulsarbot run-failure-checks |
@eolivelli @hangc0276 Sorry for the late. I supplemented a test case. PTAL~ |
final String exNp = "persistent://" + exNs + "/np"; | ||
admin.topics().createNonPartitionedTopic(exNp); | ||
// insert an invalid topic name | ||
pulsar.getLocalMetadataStore().put( |
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.
why this is related to this patch ?
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.
There are actually three scenarios I tested for partitioned topics, non-partitioned topics and exceptions while handling internal deletion.
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.
LGTM
} | ||
} | ||
|
||
log.info("Successfully send deletion command of partitioned-topics:{} " |
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.
It should be a debug level log? If we have many partitioned topics and non-partitioned-topics, we will get a very long log here, maybe print the topic count is better?
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.
Thanks for your suggestion! I have addressed the comment. PTAL~ @codelipenghui
### Motivation Currently when I need to delete a namespace forcedly, the `NamespacesBase#internalDeleteNamespaceForcefully` will firstly list all the topics under the namespace and then delete them concurrently without distinguishing wheather the topic is partitioned or non-partitioned. This behaivor will cause duplicate deletion of schema when the topic list contains partitioned topics, because all the partitions of the partitioned topic share the same schema. (cherry picked from commit e28f69e)
### Motivation Currently when I need to delete a namespace forcedly, the `NamespacesBase#internalDeleteNamespaceForcefully` will firstly list all the topics under the namespace and then delete them concurrently without distinguishing wheather the topic is partitioned or non-partitioned. This behaivor will cause duplicate deletion of schema when the topic list contains partitioned topics, because all the partitions of the partitioned topic share the same schema.
Motivation
Currently when I need to delete a namespace forcedly, the
NamespacesBase#internalDeleteNamespaceForcefully
will firstly list all the topics under the namespace and then delete them concurrently without distinguishing wheather the topic is partitioned or non-partitioned. This behaivor will cause duplicate deletion of schema when the topic list contains partitioned topics, because all the partitions of the partitioned topic share the same schema.Modifications
Distinguish partitioned topic to avoid duplicate deletion of the same schema.
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation
This PR does not need to update the docs.