You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by jl...@apache.org on 2019/10/22 21:48:04 UTC

[incubator-pinot] branch fix-enable-lead-controller-resource-logic created (now ea5293d)

This is an automated email from the ASF dual-hosted git repository.

jlli pushed a change to branch fix-enable-lead-controller-resource-logic
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git.


      at ea5293d  Catch exception when checking lead controller resource is enabled

This branch includes the following new commits:

     new ea5293d  Catch exception when checking lead controller resource is enabled

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[incubator-pinot] 01/01: Catch exception when checking lead controller resource is enabled

Posted by jl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jlli pushed a commit to branch fix-enable-lead-controller-resource-logic
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit ea5293dce9fde2c7d974b98a0ef779fd94792364
Author: jackjlli <jl...@linkedin.com>
AuthorDate: Tue Oct 22 14:47:18 2019 -0700

    Catch exception when checking lead controller resource is enabled
---
 .../org/apache/pinot/controller/LeadControllerManager.java   |  2 --
 .../pinot/server/realtime/ControllerLeaderLocator.java       | 12 +++++++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/pinot-controller/src/main/java/org/apache/pinot/controller/LeadControllerManager.java b/pinot-controller/src/main/java/org/apache/pinot/controller/LeadControllerManager.java
index 767ab8f..c3cf72e 100644
--- a/pinot-controller/src/main/java/org/apache/pinot/controller/LeadControllerManager.java
+++ b/pinot-controller/src/main/java/org/apache/pinot/controller/LeadControllerManager.java
@@ -216,8 +216,6 @@ public class LeadControllerManager {
       leadControllerResourceEnabled = LeadControllerUtils.isLeadControllerResourceEnabled(_helixManager);
     } catch (Exception e) {
       LOGGER.error("Exception when checking whether lead controller resource is enabled or not.", e);
-      _isLeadControllerResourceEnabled = false;
-      _controllerMetrics.setValueOfGlobalGauge(ControllerGauge.PINOT_LEAD_CONTROLLER_RESOURCE_ENABLED, 0L);
       return;
     }
 
diff --git a/pinot-core/src/main/java/org/apache/pinot/server/realtime/ControllerLeaderLocator.java b/pinot-core/src/main/java/org/apache/pinot/server/realtime/ControllerLeaderLocator.java
index caa8034..55d14a0 100644
--- a/pinot-core/src/main/java/org/apache/pinot/server/realtime/ControllerLeaderLocator.java
+++ b/pinot-core/src/main/java/org/apache/pinot/server/realtime/ControllerLeaderLocator.java
@@ -102,10 +102,20 @@ public class ControllerLeaderLocator {
    * Checks whether lead controller resource has been enabled or not.
    * If yes, updates lead controller pairs from the external view of lead controller resource.
    * Otherwise, updates lead controller pairs from Helix cluster leader.
+   * Note: Exception may happen due to Helix/ZK disconnect. If so, we should NOT regress the behavior back to false.
+   * Thus, simply exiting the method should be enough. Retry will be done in the next request.
    */
   private void refreshControllerLeaderMap() {
     // Checks whether lead controller resource has been enabled or not.
-    if (LeadControllerUtils.isLeadControllerResourceEnabled(_helixManager)) {
+    boolean leadControllerResourceEnabled;
+    try {
+      leadControllerResourceEnabled = LeadControllerUtils.isLeadControllerResourceEnabled(_helixManager);
+    } catch (Exception e) {
+      LOGGER.error("Exception when checking whether lead controller resource is enable or not.", e);
+      return;
+    }
+
+    if (leadControllerResourceEnabled) {
       refreshControllerLeaderMapFromLeadControllerResource();
     } else {
       refreshControllerLeaderMapFromHelixClusterLeader();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org