goutamadwant commented on code in PR #19178:
URL: https://github.com/apache/pinot/pull/19178#discussion_r4112676740


##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/manager/BaseBrokerRoutingManager.java:
##########
@@ -1351,6 +1453,13 @@ public Set<String> getServingInstances(String 
tableNameWithType) {
     return routingEntry._instanceSelector.getServingInstances();
   }
 
+  /// Returns whether the broker sees the server as enabled.
+  public boolean isServerEnabled(String instanceId) {
+    // Read the map first. A new entry is inserted only after the server is 
marked pending, and removing the pending
+    // marker publishes all routing-entry updates that precede it.
+    return _enabledServerInstanceMap.containsKey(instanceId) && 
!_serversPendingRoutingUpdate.contains(instanceId);

Review Comment:
   Updated this to use the broker's routable server snapshot together with the 
per-server pending-publication marker. The endpoint now returns 503 while a 
server is excluded by the failure detector and returns 200 again only after 
reinclusion has been published.
   
   I also renamed the helper to `isServerRoutable` and added routing-manager 
and live HTTP endpoint regressions covering the initial 200 response, 
failure-detector exclusion returning 503, reinclusion returning 200, and an 
unknown server returning 503.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to