-
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][broker] Make deleteTopicPolicies
serialized is executed when close topic.
#15811
[fix][broker] Make deleteTopicPolicies
serialized is executed when close topic.
#15811
Conversation
Please rebase this PR. |
Looks like the change breaks lots of the tests, move to 2.10.2 first |
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
thenAccept
invoke async method.deleteTopicPolicies
serialized is executed when close topic.
@@ -80,6 +80,7 @@ protected void setup() throws Exception { | |||
conf.setTlsCertificateFilePath(TLS_SERVER_CERT_FILE_PATH); | |||
conf.setTlsKeyFilePath(TLS_SERVER_KEY_FILE_PATH); | |||
conf.setTlsAllowInsecureConnection(true); | |||
conf.setTopicLevelPoliciesEnabled(false); |
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.
Because TLS is not configured for the internal Pulsar client, we get an exception when we delete the topic policy.
I'm wondering if we enable topicPolicies
and TLS but don't provide any TLS configuration for the broker's internal clients.
Do we have to check the broker`s internal client configuration when the broker starts?
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.
@mattisonchao Please open a new issue for this one.
return pulsarService.getPulsarResources().getNamespaceResources() | ||
.getPoliciesAsync(topicName.getNamespaceObject()) |
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 do we need to get the namespace policy first?
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.
We want to check if the namespace is marked as "deleted". This means the namespace is being deleted. We don't need to delete the topic policy anymore.
If we connect to the deleted
namespace. we will get an error.
Motivation
In the current implementation, when closing the topic we use
thenAccept
to delete topic policies. It will ignore the exception and do not waiting for the innerCompletableFuture
.Modifications
thenCompose
to instead ofthenAccept
deleted
, we don't need to delete topic policies.Verifying this change
Documentation
doc-not-needed
(Please explain why)