abdullah alamoudi has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/2950

Change subject: [NO ISSUE][ING] Fix race between active recovery and rebalance
......................................................................

[NO ISSUE][ING] Fix race between active recovery and rebalance

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

Details:
- In certain cases, a rebalance active suspend starts before
  recovery of an active job starts.
- When that happens, sometimes, the recovery task exists and
  the active job is not resumed after rebalance.

Change-Id: I66edb73950bb82baa1a1dfd892cb4b23bb7046be
---
M 
asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/RecoveryTask.java
1 file changed, 8 insertions(+), 3 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/50/2950/1

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 5d722e7..0460454 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
@@ -108,9 +108,14 @@
     protected Void doRecover(IRetryPolicy policy)
             throws AlgebricksException, HyracksDataException, 
InterruptedException {
         LOGGER.log(level, "Actual Recovery task has started");
-        if (listener.getState() != ActivityState.TEMPORARILY_FAILED) {
-            LOGGER.log(level, "but its state is not temp failure and so we're 
just returning");
-            return null;
+        synchronized (listener) {
+            if (cancelRecovery) {
+                return null;
+            }
+            if (listener.getState() != ActivityState.TEMPORARILY_FAILED) {
+                LOGGER.log(level, "but its state is not temp failure and so 
we're just returning");
+                return null;
+            }
         }
         LOGGER.log(level, "calling the policy");
         while (policy.retry(failure)) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I66edb73950bb82baa1a1dfd892cb4b23bb7046be
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: stabilization-f69489
Gerrit-Owner: abdullah alamoudi <[email protected]>

Reply via email to