-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[fix][broker] Skip topic auto-creation for ExtensibleLoadManager internal topics #21729
[fix][broker] Skip topic auto-creation for ExtensibleLoadManager internal topics #21729
Conversation
@@ -3432,10 +3432,10 @@ private CompletableFuture<Boolean> isAllowAutoTopicCreationAsync(final TopicName | |||
return CompletableFuture.completedFuture(false); | |||
} | |||
|
|||
// ServiceUnitStateChannelImpl.TOPIC expects to be a non-partitioned-topic now. | |||
// ExtensibleLoadManagerImpl.internal topics expects to be non-partitioned-topics now. |
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.
Should we checkBundleOwnership
in handlePartitionMetadataRequest
?
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.
I think that can be a separate PR.
Here, I think we better explicitly say we don't allow topic auto-creation for these system topics, as we pre-create them.
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.
One thing we need to think about is that checking ownership there might cause some performance impact, as we will lookup/redirect to the owner brokers for every producer and consumer creation for non-persistent topics(and other topic related operations).
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.
Left some questions.
...roker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceAutoTopicCreationTest.java
Show resolved
Hide resolved
...roker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceAutoTopicCreationTest.java
Show resolved
Hide resolved
...roker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceAutoTopicCreationTest.java
Outdated
Show resolved
Hide resolved
…rnal topics (apache#21729) (cherry picked from commit 88df040)
Could be related to the increased flakiness of ExtensibleLoadManagerTest.testIsolationPolicy, #20608 |
…rnal topics (apache#21729) (cherry picked from commit 88df040)
…rnal topics (apache#21729) (cherry picked from commit 88df040) (cherry picked from commit b403f3c)
…rnal topics (apache#21729) (cherry picked from commit 88df040) (cherry picked from commit b403f3c)
Motivation
For our load data system topics such as,
non-persistent://pulsar/system/loadbalancer-broker-load-data
,allowAutoTopicCreationType=partitioned
causes other broker's producer creation to incorrectly create a new partitioned topic (although we pre-create the system topics as non-partitioned topics). Because of this, the leader broker cannot collect all brokers' load data as the other brokers publish the load data in different topics(partitioned topics).For non-persistent topics, Producer creation incorrectly creates a new partitioned topic, although the topic was created as a non-partitioned topic before.
Producer creation first fetches the partitionMedatadata from the broker, and when fetching this partitionMedatadata, brokers automatically create a new one with the conditions like the below code. The problem is that the broker serving
handlePartitionMetadataRequest
might not be the owner broker (I don't seecheckBundleOwnership
in thehandlePartitionMetadataRequest
code path.) Hence, thetopicExists
condition in the below code can becomefalse
, if not owner, and create a new partitioned topic (by default).https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java#L3167-L3175
Modifications
Skip to auto-create ExtensibleLoadManager internal system topics, as we precreate them now.
Verifying this change
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: