abdullah alamoudi has submitted this change and it was merged.

Change subject: [NO ISSUE][ING] Ensure Active recovery is triggerred
......................................................................


[NO ISSUE][ING] Ensure Active recovery is triggerred

- user model changes: no
- storage format changes: no
- interface changes: no

details:
- Previously, when the cluster recovers and tries to notify the
  active events handler to resume recovery tasks, the notification
  is performed on the listener but the task waits on itself.
- After this change, the task waits on the listener and so
  the notification wakes up the recovery task correctly.

Change-Id: I5fe3a2013a4cb92313648fd04ff2ef3c417270fb
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2385
Sonar-Qube: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mb...@apache.org>
---
M 
asterixdb/asterix-active/src/main/java/org/apache/asterix/active/IActiveNotificationHandler.java
M 
asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveEntityEventsListener.java
M 
asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveNotificationHandler.java
M 
asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/RecoveryTask.java
M 
asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/api/IActiveEntityController.java
5 files changed, 5 insertions(+), 9 deletions(-)

Approvals:
  Jenkins: Verified; No violations found; ; Verified
  Michael Blow: Looks good to me, approved



diff --git 
a/asterixdb/asterix-active/src/main/java/org/apache/asterix/active/IActiveNotificationHandler.java
 
b/asterixdb/asterix-active/src/main/java/org/apache/asterix/active/IActiveNotificationHandler.java
index 8b9f232..1d29828 100644
--- 
a/asterixdb/asterix-active/src/main/java/org/apache/asterix/active/IActiveNotificationHandler.java
+++ 
b/asterixdb/asterix-active/src/main/java/org/apache/asterix/active/IActiveNotificationHandler.java
@@ -21,7 +21,6 @@
 
 import org.apache.asterix.active.message.ActivePartitionMessage;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
-import org.apache.hyracks.api.job.IJobLifecycleListener;
 
 /**
  * Represents the notification handler for events of active entity jobs
@@ -30,10 +29,8 @@
 
     /**
      * Recover all active jobs that failed
-     *
-     * @throws HyracksDataException
      */
-    void recover() throws HyracksDataException;
+    void recover();
 
     /**
      * Set whether handler initialization has completed or not
diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveEntityEventsListener.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveEntityEventsListener.java
index 12bcc0d2..1758daa 100644
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveEntityEventsListener.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveEntityEventsListener.java
@@ -353,7 +353,7 @@
     }
 
     @Override
-    public synchronized void recover() throws HyracksDataException {
+    public synchronized void recover() {
         LOGGER.log(level, "Recover is called on " + entityId);
         if (retryPolicyFactory == NoRetryPolicyFactory.INSTANCE) {
             LOGGER.log(level, "But it has no recovery policy, so it is set to 
permanent failure");
diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveNotificationHandler.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveNotificationHandler.java
index b8ed03f..e8bcb10 100644
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveNotificationHandler.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveNotificationHandler.java
@@ -209,7 +209,7 @@
     }
 
     @Override
-    public synchronized void recover() throws HyracksDataException {
+    public synchronized void recover() {
         LOGGER.log(level, "Starting active recovery");
         for (IActiveEntityEventsListener listener : 
entityEventListeners.values()) {
             synchronized (listener) {
diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/RecoveryTask.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/RecoveryTask.java
index ffef251..dacd0ee 100644
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/RecoveryTask.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/RecoveryTask.java
@@ -128,7 +128,7 @@
                     if (cancelRecovery) {
                         return null;
                     }
-                    wait();
+                    listener.wait();
                 }
             }
             IMetadataLockManager lockManager = 
metadataProvider.getApplicationContext().getMetadataLockManager();
diff --git 
a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/api/IActiveEntityController.java
 
b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/api/IActiveEntityController.java
index c73a433..7103fd8 100644
--- 
a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/api/IActiveEntityController.java
+++ 
b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/api/IActiveEntityController.java
@@ -68,9 +68,8 @@
     /**
      * Start failure recovery
      *
-     * @throws HyracksDataException
      */
-    void recover() throws HyracksDataException;
+    void recover();
 
     /**
      * Add dataset to the list of associated datasets

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/2385
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5fe3a2013a4cb92313648fd04ff2ef3c417270fb
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: abdullah alamoudi <bamou...@gmail.com>
Gerrit-Reviewer: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Murtadha Hubail <mhub...@apache.org>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: abdullah alamoudi <bamou...@gmail.com>

Reply via email to