heesung-sn commented on code in PR #23119: URL: https://github.com/apache/pulsar/pull/23119#discussion_r1703466855
########## pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java: ########## @@ -1763,6 +1764,9 @@ public void listen(StateChangeListener listener) { @Override public Set<Map.Entry<String, ServiceUnitStateData>> getOwnershipEntrySet() { + if (tableview == null) { Review Comment: ``` tableview = pulsar.getClient().newTableViewBuilder(schema) .topic(TOPIC) .loadConf(Map.of( "topicCompactionStrategyClassName", ServiceUnitStateCompactionStrategy.class.getName())) .create(); tableview.listen((key, value) -> handle(key, value)); ``` plz note that this table view only reacts on the new messages after init. This is because we don't want to make this broker react on the old messages whose ownership have been already established. -- 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: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org