Skip to content

Commit

Permalink
[improve][broker] check system topic is used before configuring syste…
Browse files Browse the repository at this point in the history
…m topic (ExtensibleLoadManagerImpl only) (apache#23381)
  • Loading branch information
heesung-sn authored Oct 1, 2024
1 parent 9980967 commit e0b754d
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.apache.pulsar.broker.loadbalance.LoadManager;
import org.apache.pulsar.broker.loadbalance.extensions.channel.ServiceUnitStateChannel;
import org.apache.pulsar.broker.loadbalance.extensions.channel.ServiceUnitStateChannelImpl;
import org.apache.pulsar.broker.loadbalance.extensions.channel.ServiceUnitStateTableViewImpl;
import org.apache.pulsar.broker.loadbalance.extensions.channel.ServiceUnitStateTableViewSyncer;
import org.apache.pulsar.broker.loadbalance.extensions.data.BrokerLoadData;
import org.apache.pulsar.broker.loadbalance.extensions.data.BrokerLookupData;
Expand Down Expand Up @@ -992,7 +993,7 @@ protected void monitor() {
if (isChannelOwner) {
// System topic config might fail due to the race condition
// with topic policy init(Topic policies cache have not init).
if (!configuredSystemTopics) {
if (isPersistentSystemTopicUsed() && !configuredSystemTopics) {
configuredSystemTopics = configureSystemTopics(pulsar, COMPACTION_THRESHOLD);
}
if (role != Leader) {
Expand Down Expand Up @@ -1080,4 +1081,11 @@ boolean running() {
private boolean disabled() {
return state.get() == State.DISABLED;
}

private boolean isPersistentSystemTopicUsed() {
return ServiceUnitStateTableViewImpl.class.getName()
.equals(pulsar.getConfiguration().getLoadManagerServiceUnitStateTableViewClassName());
}


}

0 comments on commit e0b754d

Please sign in to comment.