[pulsar-broker] Fix topic policy update#8564
[pulsar-broker] Fix topic policy update#8564rdhabalia wants to merge 4 commits intoapache:masterfrom
Conversation
|
/pulsarbot run-failure-checks |
| public void setup() throws Exception { | ||
| conf.setLoadBalancerEnabled(true); | ||
| conf.setTopicLevelPoliciesEnabled(true); | ||
| conf.setSystemTopicEnabled(true); |
There was a problem hiding this comment.
This change is affecting all of the other tests in this file.
Do we have some side effect?
Are we going to use more and more resources for al the tests in this file?
My question is more general, sometimes we enable feature in common setup utilities, with the possibility to alter the semantics of the other tests.
Probably in this case there is no issue. Please clarify, I am still new to this suite of tests
| } | ||
|
|
||
| @Test | ||
| public void testDedupTopicOwnership() throws Exception { |
There was a problem hiding this comment.
Seems the tests can't cover the changes? I think we must start more than 1 brokers.
| @PathParam("namespace") String namespace, | ||
| @PathParam("topic") @Encoded String encodedTopic) { | ||
| validateTopicName(tenant, namespace, encodedTopic); | ||
| validateTopicOwnership(topicName, true); |
There was a problem hiding this comment.
we don't need to validate the topic owner ship for topic level policy since after the policy updated, the broker will get a policy change event, if the broker own the topic, the broker will apply the policy change to that topic
|
Because this PR is opened for a long time. I will close this PR. Feel free to reopen it if you needed. |
Motivation
Right now, TopicPolicy doesn't have auto refresh mechanism and trigger of refresh is admin api change. Now, enabling dedup admin api call can go to any broker and owner broker doesn't refresh and apply the change. Also, listening to all topics for every broker might not be scalable so, let redirect to broker which owns the topic and update the topic policy cache.
Modification
redirect and let topic owner broker to enable dedup and refresh the topic policy cache.