diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index d95679ee9cd..3744a1ecb64 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -109,6 +109,9 @@ Release 2.7.0 - UNRELEASED YARN-2907. SchedulerNode#toString should print all resource detail instead of only memory. (Rohith via junping_du) + YARN-2136. Changed RMStateStore to ignore store opearations when fenced. + (Varun Saxena via jianhe) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/RMStateStore.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/RMStateStore.java index 35a54c3ab6c..00e1dfc387a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/RMStateStore.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/RMStateStore.java @@ -18,6 +18,7 @@ package org.apache.hadoop.yarn.server.resourcemanager.recovery; +import java.util.EnumSet; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -26,6 +27,7 @@ import java.util.TreeMap; import javax.crypto.SecretKey; +import com.google.common.annotations.VisibleForTesting; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience.Private; @@ -88,7 +90,8 @@ public abstract class RMStateStore extends AbstractService { public static final Log LOG = LogFactory.getLog(RMStateStore.class); private enum RMStateStoreState { - DEFAULT + ACTIVE, + FENCED }; private static final StateMachineFactory( - RMStateStoreState.DEFAULT) - .addTransition(RMStateStoreState.DEFAULT, RMStateStoreState.DEFAULT, + RMStateStoreState.ACTIVE) + .addTransition(RMStateStoreState.ACTIVE, RMStateStoreState.ACTIVE, RMStateStoreEventType.STORE_APP, new StoreAppTransition()) - .addTransition(RMStateStoreState.DEFAULT, RMStateStoreState.DEFAULT, + .addTransition(RMStateStoreState.ACTIVE, RMStateStoreState.ACTIVE, RMStateStoreEventType.UPDATE_APP, new UpdateAppTransition()) - .addTransition(RMStateStoreState.DEFAULT, RMStateStoreState.DEFAULT, + .addTransition(RMStateStoreState.ACTIVE, RMStateStoreState.ACTIVE, RMStateStoreEventType.REMOVE_APP, new RemoveAppTransition()) - .addTransition(RMStateStoreState.DEFAULT, RMStateStoreState.DEFAULT, + .addTransition(RMStateStoreState.ACTIVE, RMStateStoreState.ACTIVE, RMStateStoreEventType.STORE_APP_ATTEMPT, new StoreAppAttemptTransition()) - .addTransition(RMStateStoreState.DEFAULT, RMStateStoreState.DEFAULT, - RMStateStoreEventType.UPDATE_APP_ATTEMPT, new UpdateAppAttemptTransition()); + .addTransition(RMStateStoreState.ACTIVE, RMStateStoreState.ACTIVE, + RMStateStoreEventType.UPDATE_APP_ATTEMPT, new UpdateAppAttemptTransition()) + .addTransition(RMStateStoreState.ACTIVE, RMStateStoreState.FENCED, + RMStateStoreEventType.FENCED) + .addTransition(RMStateStoreState.FENCED, RMStateStoreState.FENCED, + EnumSet.of( + RMStateStoreEventType.STORE_APP, + RMStateStoreEventType.UPDATE_APP, + RMStateStoreEventType.REMOVE_APP, + RMStateStoreEventType.STORE_APP_ATTEMPT, + RMStateStoreEventType.UPDATE_APP_ATTEMPT, + RMStateStoreEventType.FENCED)); private final StateMachine