[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.
| 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.
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.
@mattisonchao Please open a new issue for this one.
| return pulsarService.getPulsarResources().getNamespaceResources() | ||
| .getPoliciesAsync(topicName.getNamespaceObject()) |
There was a problem hiding this comment.
Why do we need to get the namespace policy first?
There was a problem hiding this comment.
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
thenAcceptto delete topic policies. It will ignore the exception and do not waiting for the innerCompletableFuture.Modifications
thenComposeto instead ofthenAcceptdeleted, we don't need to delete topic policies.Verifying this change
Documentation
doc-not-needed(Please explain why)