Skip to content
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

[bugfix] Prevent Automatic Topic Creation during namespace deletion #17609

Merged

Conversation

eolivelli
Copy link
Contributor

@eolivelli eolivelli commented Sep 13, 2022

Motivation

During the deletion of a namespace we don't want that autoTopicCreation triggers the creation of topics.
This is related to #17308 but it deals only with Namespace and Tenant deletion.

Modifications

Consider "Policies.deleted" while deciding if autoTopicCreation is available or not

Verifying this change

I will add tests

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)

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Sep 13, 2022
@eolivelli
Copy link
Contributor Author

@poorbarcode @dlg99 PTAL

@eolivelli eolivelli marked this pull request as ready for review September 13, 2022 10:18
@eolivelli
Copy link
Contributor Author

@poorbarcode unfortunately my test case doesn't cover well the change, because basically the automatic topic creation is prevented earlier, because we have the check about policies.deleted in PulsarWebResources.checkLocalOrGetPeerReplicationCluster()

do you have some suggestions ?

Copy link
Contributor

@poorbarcode poorbarcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reduces the probability of problems occurring. When the namespace deletion instruction is not processed by the current broker, may succeed in creating the topic because the meta data has a brief cache.

@eolivelli
Copy link
Contributor Author

When the namespace deletion instruction is not processed by the current broker, may succeed in creating the topic because the meta data has a brief cache.

This is a good point, but I would defer it to the most bigger issue of cache consistency

@eolivelli
Copy link
Contributor Author

@poorbarcode I added another test that demonstrates that this patch is covering one edge case that you mentioned.
We must prevent auto topic creation not only during lookup but also while creating a consumer or a producer.

The new test covers this change now

@eolivelli eolivelli force-pushed the impl/prevent-auto-creation-while-deletion branch from d5bc53f to 3a53155 Compare September 13, 2022 14:32
Copy link
Contributor

@dlg99 dlg99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eolivelli eolivelli force-pushed the impl/prevent-auto-creation-while-deletion branch from 3a53155 to b74b8ec Compare September 14, 2022 07:59
@codelipenghui codelipenghui added this to the 2.12.0 milestone Sep 14, 2022
@eolivelli eolivelli force-pushed the impl/prevent-auto-creation-while-deletion branch from b74b8ec to cfc2f5a Compare September 15, 2022 08:36
@eolivelli eolivelli merged commit af98304 into apache:master Sep 15, 2022
@eolivelli eolivelli deleted the impl/prevent-auto-creation-while-deletion branch September 15, 2022 15:38
eolivelli added a commit to datastax/pulsar that referenced this pull request Sep 15, 2022
@Technoboy- Technoboy- removed this from the 2.12.0 milestone Sep 20, 2022
@Technoboy- Technoboy- added this to the 2.11.0 milestone Sep 20, 2022
congbobo184 pushed a commit that referenced this pull request Nov 14, 2022
@congbobo184 congbobo184 added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Nov 14, 2022
congbobo184 pushed a commit that referenced this pull request Dec 7, 2022
congbobo184 pushed a commit to congbobo184/pulsar that referenced this pull request Dec 7, 2022
…eNamespaceWithAutomaticTopicCreation import
congbobo184 pushed a commit to congbobo184/pulsar that referenced this pull request Dec 7, 2022
…eNamepacesWithAutomaticTopicCreation import
congbobo184 added a commit that referenced this pull request Dec 7, 2022
### Motivation
fix cherry-pick #17609 import
fix cherry-pick #17957  import
fix cherry-pick #16878 lose problem
fix cherry-pick #17503 problem
liangyepianzhou pushed a commit that referenced this pull request Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker cherry-picked/branch-2.9 Archived: 2.9 is end of life cherry-picked/branch-2.10 cherry-picked/branch-2.11 doc-not-needed Your PR changes do not impact docs release/2.9.4 release/2.10.3 type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants