gaoran10 commented on code in PR #19730:
URL: https://github.com/apache/pulsar/pull/19730#discussion_r1132040771


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/store/TableViewLoadDataStoreImpl.java:
##########
@@ -61,30 +70,58 @@ public CompletableFuture<Void> removeAsync(String key) {
 
     @Override
     public Optional<T> get(String key) {
+        validateTableViewStart();

Review Comment:
   According to this code block, even if it failed to start the 
`topBundlesLoadDataStore`,  the `playLeader` still can complete, if the 
UnloadScheduler tries to find bundles that need to unload, it will encounter 
IllegalStateException("table view has not been started").
   
   ```
       private void playLeader() {
           this.pulsar.getLoadManagerExecutor().execute(() -> {
               serviceUnitStateChannel.scheduleOwnershipMonitor();
               waitForLoadStoreInit();
               try {
                   topBundlesLoadDataStore.startTableView();
               } catch (Throwable e) {
                   log.error("The new leader:{} failed to start 
topBundlesLoadDataStore tableview",
                           pulsar.getLookupServiceAddress(), e);
               }
               ...
               log.info("This broker:{} is the leader now.", 
pulsar.getLookupServiceAddress());
           });
       }
   
   ```



-- 
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]

Reply via email to