Repository: asterixdb
Updated Branches:
  refs/heads/master 254eeaa59 -> 0f294d0d1


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


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/0f294d0d
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/0f294d0d
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/0f294d0d

Branch: refs/heads/master
Commit: 0f294d0d1e2d5718a02e163dcd34c9bea1956963
Parents: 254eeaa
Author: Abdullah Alamoudi <bamou...@gmail.com>
Authored: Sun Feb 11 13:41:48 2018 -0800
Committer: abdullah alamoudi <bamou...@gmail.com>
Committed: Wed Feb 14 10:29:32 2018 -0800

----------------------------------------------------------------------
 .../org/apache/asterix/active/IActiveNotificationHandler.java   | 5 +----
 .../apache/asterix/app/active/ActiveEntityEventsListener.java   | 2 +-
 .../apache/asterix/app/active/ActiveNotificationHandler.java    | 2 +-
 .../main/java/org/apache/asterix/app/active/RecoveryTask.java   | 2 +-
 .../apache/asterix/metadata/api/IActiveEntityController.java    | 3 +--
 5 files changed, 5 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0f294d0d/asterixdb/asterix-active/src/main/java/org/apache/asterix/active/IActiveNotificationHandler.java
----------------------------------------------------------------------
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 @@ package org.apache.asterix.active;
 
 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 @@ public interface IActiveNotificationHandler {
 
     /**
      * Recover all active jobs that failed
-     *
-     * @throws HyracksDataException
      */
-    void recover() throws HyracksDataException;
+    void recover();
 
     /**
      * Set whether handler initialization has completed or not

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0f294d0d/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveEntityEventsListener.java
----------------------------------------------------------------------
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 12bcc0d..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 @@ public abstract class ActiveEntityEventsListener implements 
IActiveEntityControl
     }
 
     @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");

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0f294d0d/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveNotificationHandler.java
----------------------------------------------------------------------
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 @@ public class ActiveNotificationHandler extends 
SingleThreadEventProcessor<Active
     }
 
     @Override
-    public synchronized void recover() throws HyracksDataException {
+    public synchronized void recover() {
         LOGGER.log(level, "Starting active recovery");
         for (IActiveEntityEventsListener listener : 
entityEventListeners.values()) {
             synchronized (listener) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0f294d0d/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/RecoveryTask.java
----------------------------------------------------------------------
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 @@ public class RecoveryTask {
                     if (cancelRecovery) {
                         return null;
                     }
-                    wait();
+                    listener.wait();
                 }
             }
             IMetadataLockManager lockManager = 
metadataProvider.getApplicationContext().getMetadataLockManager();

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0f294d0d/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/api/IActiveEntityController.java
----------------------------------------------------------------------
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 @@ public interface IActiveEntityController extends 
IActiveEntityEventsListener {
     /**
      * Start failure recovery
      *
-     * @throws HyracksDataException
      */
-    void recover() throws HyracksDataException;
+    void recover();
 
     /**
      * Add dataset to the list of associated datasets

Reply via email to