heesung-sn commented on code in PR #23152:
URL: https://github.com/apache/pulsar/pull/23152#discussion_r1713207883
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:
##########
@@ -324,6 +324,17 @@ public synchronized void start() throws
PulsarServerException {
"topicCompactionStrategyClassName",
ServiceUnitStateCompactionStrategy.class.getName()))
.create();
+ tableview.forEach((serviceUnit, data) -> {
+ if (debug) {
+ log.info("Loaded the service unit state data. serviceUnit:
{}, data: {}", serviceUnit, data);
+ }
+ ServiceUnitState state = state(data);
+ if (state.equals(Owned) && isTargetBroker(data.dstBroker())) {
+ pulsar.getNamespaceService()
+
.onNamespaceBundleOwned(LoadManagerShared.getNamespaceBundle(pulsar,
serviceUnit));
+ stateChangeListeners.notify(serviceUnit, data, null);
Review Comment:
Actually, I think we can skip `stateChangeListeners.notify` as this is
designed for active state change events.
can we run this after `tableview.listen` below? I think we better register
`tableview.listen` asap.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]