-
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] Fix system service namespace create internal event topic. #17867
[fix][broker] Fix system service namespace create internal event topic. #17867
Conversation
pulsar-broker/src/test/java/org/apache/pulsar/broker/systopic/PartitionedSystemTopicTest.java
Show resolved
Hide resolved
@@ -1567,7 +1567,8 @@ public CompletableFuture<ManagedLedgerConfig> getManagedLedgerConfig(TopicName t | |||
RetentionPolicies retentionPolicies = null; | |||
OffloadPoliciesImpl topicLevelOffloadPolicies = null; | |||
|
|||
if (pulsar.getConfig().isTopicLevelPoliciesEnabled()) { | |||
if (pulsar.getConfig().isTopicLevelPoliciesEnabled() | |||
&& !NamespaceService.isSystemServiceNamespace(namespace.toString())) { |
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.
Maybe we can also move this check !NamespaceService.isSystemServiceNamespace(namespace.toString())
to pulsar.getTopicPoliciesService().getTopicPolicies(topicName)
?
Because I see you already check it at SystemTopicBasedTopicPoliciesService#sendTopicPolicyEvent
.
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.
Ah, we should avoid creating the topic first. This is the root cause.
@@ -101,6 +101,10 @@ public CompletableFuture<Void> updateTopicPoliciesAsync(TopicName topicName, Top | |||
|
|||
private CompletableFuture<Void> sendTopicPolicyEvent(TopicName topicName, ActionType actionType, | |||
TopicPolicies policies) { | |||
if (NamespaceService.isHeartbeatNamespace(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 don't we use NamespaceService#isSystemServiceNamespace
?
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.
Keep the same with line 240.
ee9c33b
to
e5c3372
Compare
e5c3372
to
cf1d485
Compare
Codecov Report
@@ Coverage Diff @@
## master #17867 +/- ##
=========================================
Coverage ? 46.73%
Complexity ? 17838
=========================================
Files ? 1573
Lines ? 128214
Branches ? 14099
=========================================
Hits ? 59923
Misses ? 62135
Partials ? 6156
Flags with carried forward coverage won't be shown. Click here to find out more. |
…c. (apache#17867) (cherry picked from commit 29baa0b)
…c. (apache#17867) (cherry picked from commit 29baa0b) (cherry picked from commit 14d68a4)
…c. (apache#17867) (cherry picked from commit 29baa0b) (cherry picked from commit 14d68a4)
Motivation
Fix system service namespace(heartbeat namespace) creates internal
__change_events
topics:Documentation
doc-not-needed
(Please explain why)
Matching PR in forked repository
PR in forked repository: https://github.com/Technoboy-/pulsar/pull/8