You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ra...@apache.org on 2022/03/08 19:34:07 UTC

[atlas] branch branch-2.0 updated: ATLAS-4549: Issue with brining up Atlas in HA enabled mode with Index recovery enabled

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

radhikakundam pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new c07d6fb  ATLAS-4549: Issue with brining up Atlas in HA enabled mode with Index recovery enabled
c07d6fb is described below

commit c07d6fbf5959c6f79f3293bfafd2407df21b6b64
Author: Radhika Kundam <rk...@cloudera.com>
AuthorDate: Fri Feb 4 13:30:34 2022 -0800

    ATLAS-4549: Issue with brining up Atlas in HA enabled mode with Index recovery enabled
    
    Signed-off-by: radhikakundam <ra...@apache.org>
    (cherry picked from commit 6dad2f6f35c97cb3fee82c5aee7aa932325e688a)
---
 .../atlas/repository/graph/IndexRecoveryService.java       | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/repository/src/main/java/org/apache/atlas/repository/graph/IndexRecoveryService.java b/repository/src/main/java/org/apache/atlas/repository/graph/IndexRecoveryService.java
index 57964d5..caf3163 100644
--- a/repository/src/main/java/org/apache/atlas/repository/graph/IndexRecoveryService.java
+++ b/repository/src/main/java/org/apache/atlas/repository/graph/IndexRecoveryService.java
@@ -123,7 +123,11 @@ public class IndexRecoveryService implements Service, ActiveStateChangeHandler {
 
     @Override
     public void instanceIsPassive() throws AtlasException {
-        LOG.info("IndexRecoveryService.instanceIsPassive(): no action needed.");
+        LOG.info("==> IndexRecoveryService.instanceIsPassive()");
+
+        stop();
+
+        LOG.info("<== IndexRecoveryService.instanceIsPassive()");
     }
 
     @Override
@@ -138,7 +142,13 @@ public class IndexRecoveryService implements Service, ActiveStateChangeHandler {
             return;
         }
 
-        indexHealthMonitor.start();
+        try {
+            if (indexHealthMonitor.getState() == Thread.State.NEW) {
+                indexHealthMonitor.start();
+            }
+        } catch (Exception ex) {
+            LOG.error("Error while starting Index Health Monitor", ex);
+        }
     }
 
     private static class RecoveryThread implements Runnable {