J-HowHuang commented on code in PR #19221:
URL: https://github.com/apache/pinot/pull/19221#discussion_r3771198258


##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/manager/BaseBrokerRoutingManager.java:
##########
@@ -693,6 +694,14 @@ public void buildRouting(String tableNameWithType) {
     _globalLock.readLock().lock();
     try {
       buildRoutingInternal(tableNameWithType);
+    } catch (Exception e) {
+      // Creating the instance selector registers the table's replica health 
gauges, which happens before the
+      // routing entry is stored. If the build failed in between there is no 
routing entry to clean them up
+      // later, so they would keep being exported frozen at a value that no 
longer describes the table
+      if (!_routingEntryMap.containsKey(tableNameWithType)) {
+        BaseInstanceSelector.removeReplicaHealthMetrics(_brokerMetrics, 
tableNameWithType);
+      }

Review Comment:
   the old selector lives in the present routing entry, and will keep emitting 
the gauge correctly. The newly created selector would be discarded and no need 
to take action on that



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