mcvsubbu commented on a change in pull request #4553: Refactor 
ControllerLeaderLocator
URL: https://github.com/apache/incubator-pinot/pull/4553#discussion_r325371893
 
 

 ##########
 File path: 
pinot-core/src/main/java/org/apache/pinot/server/realtime/ControllerLeaderLocator.java
 ##########
 @@ -177,16 +177,20 @@ private void 
refreshControllerLeaderMapFromLeadControllerResource() {
    * Updates lead controller pairs from Helix cluster leader.
    */
   private void refreshControllerLeaderMapFromHelixClusterLeader() {
-    Pair<String, Integer> helixClusterLeader = getHelixClusterLeader();
-    if (helixClusterLeader == null) {
-      _cachedControllerLeaderValid = false;
-      return;
-    }
-    for (int i = 0; i < 
Helix.NUMBER_OF_PARTITIONS_IN_LEAD_CONTROLLER_RESOURCE; i++) {
-      _cachedControllerLeaderMap.put(i, helixClusterLeader);
+    boolean refreshSucceeded = false;
+    try {
+      Pair<String, Integer> helixClusterLeader = getHelixClusterLeader();
+      if (helixClusterLeader == null) {
+        return;
+      }
+      for (int i = 0; i < 
Helix.NUMBER_OF_PARTITIONS_IN_LEAD_CONTROLLER_RESOURCE; i++) {
+        _cachedControllerLeaderMap.put(i, helixClusterLeader);
+      }
+      refreshSucceeded = true;
+      LOGGER.info("Refreshed controller leader map successfully.");
+    } finally {
+      _cachedControllerLeaderValid = refreshSucceeded;
 
 Review comment:
   Please add a log if the refresh failed for any reason.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to