heesung-sn commented on code in PR #19410:
URL: https://github.com/apache/pulsar/pull/19410#discussion_r1095356459


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:
##########
@@ -279,67 +318,112 @@ private boolean isChannelOwner() {
     public CompletableFuture<String> getOwnerAsync(String serviceUnit) {
         validateChannelState(Started, true);
         ServiceUnitStateData data = tableview.get(serviceUnit);
-        if (data == null) {
-            return CompletableFuture.completedFuture(null);
-        }
-        switch (data.state()) {
+        ServiceUnitState state = data == null ? Free : data.state();
+        ownerLookUpCounters.get(state).incrementAndGet();
+        switch (state) {
             case Owned, Splitting -> {
                 return CompletableFuture.completedFuture(data.broker());
             }
             case Assigned, Released -> {
                 return deferGetOwnerRequest(serviceUnit);
             }
+            case Free -> {
+                return CompletableFuture.completedFuture(null);
+            }
             default -> {
-                return null;
+                throw new IllegalStateException("Invalid service unit state:" 
+ data.state());

Review Comment:
   I agree. I also saw that this got updated in your PR, 
https://github.com/apache/pulsar/pull/19102/files. Can you merge the PR today? 
I can rebase this PR on yours tomorrow. 
   
   



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