-
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 delete authentication policies when delete topic. #12215
fix delete authentication policies when delete topic. #12215
Conversation
@eolivelli - PTAL |
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Outdated
Show resolved
Hide resolved
/pulsarbot run-failure-checks |
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Outdated
Show resolved
Hide resolved
import org.testng.annotations.BeforeClass; | ||
import org.testng.annotations.Test; | ||
|
||
public class DeleteAuthenticationPoliciesTest extends MockedPulsarServiceBaseTest { |
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.
Add a test group?
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 already have AuthenticatedProducerConsumerTest
there, it's better to move the test to AuthenticatedProducerConsumerTest
which will bring convenience to test maintenance
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.
Fix it.
|
||
private static void waitForChange() { | ||
try { | ||
Thread.sleep(100); |
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.
Please avoid sleep, it's better to use Awaitbility to instead.
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.
Fix it
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Outdated
Show resolved
Hide resolved
.deleteTopicAuthenticationWithRetry(topicName.toString(), deleteTopicAuthenticationFuture, 5); | ||
deleteTopicAuthenticationFuture.whenComplete((r1, ex1) -> { | ||
if (ex1 != null) { | ||
asyncResponse.resume(new RestException(ex1)); |
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.
Please add error log for the authentication delete failed exception.
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Outdated
Show resolved
Hide resolved
/pulsarbot run-failure-checks |
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Outdated
Show resolved
Hide resolved
@hangc0276 @codelipenghui @michaeljmarshall All comments were fixed, could you take a look again? |
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
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Show resolved
Hide resolved
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.
Please check @315157973's comment.
* up/master: fix delete authentication policies when delete topic. (apache#12215) [Broker] Fix messageDedup delete inactive producer name (apache#12493) Fixed getting children of parent nodes in LocalMemoryMetadataStore (apache#12491) Update Producer stats on producer close() (apache#12500) docs(cli):add restart command in pulsar-daemon (apache#12373) Add the pulsar java property memory allocator doc (apache#12481) [Doc]Update ci-documentbot.yml (apache#12480)
(cherry picked from commit 3e57828)
I have fixed the cherry-pick issue in ffe574d , Please help review this commit, thanks. @LeBW @codelipenghui |
(cherry picked from commit 3e57828)
Fixes #11876
Motivation
When delete the topic, its authentication policies in zookeeper are not deleted.
Modifications
delete the authentication policies of the topic when delete the topic.
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation
Check the box below and label this PR (if you have committer privilege).
Need to update docs?
bug fix