Skip to content

Commit

Permalink
[improve][broker] Exclude system topics from namespace level publish …
Browse files Browse the repository at this point in the history
…and dispatch rate limiting (apache#23589)

(cherry picked from commit 9bcbb20)
(cherry picked from commit aa4dbf3)
  • Loading branch information
nikhil-ctds committed Nov 14, 2024
1 parent 57c8bac commit 914e937
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
import org.apache.pulsar.broker.intercept.BrokerInterceptors;
import org.apache.pulsar.broker.loadbalance.LeaderBroker;
import org.apache.pulsar.broker.loadbalance.LeaderElectionService;
import org.apache.pulsar.broker.loadbalance.LinuxInfoUtils;
import org.apache.pulsar.broker.loadbalance.LoadManager;
import org.apache.pulsar.broker.loadbalance.LoadReportUpdaterTask;
import org.apache.pulsar.broker.loadbalance.LoadResourceQuotaUpdaterTask;
Expand Down Expand Up @@ -747,14 +746,6 @@ public void start() throws PulsarServerException {
config.getDefaultRetentionTimeInMinutes() * 60));
}

if (config.getLoadBalancerOverrideBrokerNicSpeedGbps().isEmpty()
&& config.isLoadBalancerEnabled()
&& LinuxInfoUtils.isLinux()
&& !LinuxInfoUtils.checkHasNicSpeeds()) {
throw new IllegalStateException("Unable to read VM NIC speed. You must set "
+ "[loadBalancerOverrideBrokerNicSpeedGbps] to override it when load balancer is enabled.");
}

localMetadataSynchronizer = StringUtils.isNotBlank(config.getMetadataSyncEventTopic())
? new PulsarMetadataEventSynchronizer(this, config.getMetadataSyncEventTopic())
: null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ public void testCheckOwnershipAsync() throws Exception {
TopicName topicName = TopicName.get(defaultTestNamespace + "/test-check-ownership");
NamespaceBundle bundle = getBundleAsync(pulsar1, topicName).get();
// 1. The bundle is never assigned.
retryStrategically((test) -> {
try {
return !primaryLoadManager.checkOwnershipAsync(Optional.empty(), bundle).get()
&& !secondaryLoadManager.checkOwnershipAsync(Optional.empty(), bundle).get();
} catch (Exception e) {
return false;
}
}, 5, 200);
assertFalse(primaryLoadManager.checkOwnershipAsync(Optional.empty(), bundle).get());
assertFalse(secondaryLoadManager.checkOwnershipAsync(Optional.empty(), bundle).get());

Expand Down

0 comments on commit 914e937

Please sign in to comment.