hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecl...@apache.org
Subject git commit: HBASE-10314 Add Chaos Monkey that doesn't touch the master
Date Thu, 18 Sep 2014 18:44:38 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 dc20ab3bc -> 9d50488f2


HBASE-10314 Add Chaos Monkey that doesn't touch the master


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/9d50488f
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/9d50488f
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/9d50488f

Branch: refs/heads/branch-1
Commit: 9d50488f20d3573904733ba9a0076dbce4a338de
Parents: dc20ab3
Author: Elliott Clark <eclark@apache.org>
Authored: Thu Sep 18 11:42:17 2014 -0700
Committer: Elliott Clark <eclark@apache.org>
Committed: Thu Sep 18 11:44:13 2014 -0700

----------------------------------------------------------------------
 .../hbase/chaos/factories/MonkeyFactory.java    |  2 +
 .../StressAssignmentManagerMonkeyFactory.java   | 64 ++++++++++++++++++++
 2 files changed, 66 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/9d50488f/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/factories/MonkeyFactory.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/factories/MonkeyFactory.java
b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/factories/MonkeyFactory.java
index 532839e..bdf05d1 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/factories/MonkeyFactory.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/factories/MonkeyFactory.java
@@ -67,12 +67,14 @@ public abstract class MonkeyFactory {
   public static final String SLOW_DETERMINISTIC = "slowDeterministic";
   public static final String UNBALANCE = "unbalance";
   public static final String SERVER_KILLING = "serverKilling";
+  public static final String STRESS_AM = "stressAM";
 
   public static Map<String, MonkeyFactory> FACTORIES = ImmutableMap.<String,MonkeyFactory>builder()
     .put(CALM, new CalmMonkeyFactory())
     .put(SLOW_DETERMINISTIC, new SlowDeterministicMonkeyFactory())
     .put(UNBALANCE, new UnbalanceMonkeyFactory())
     .put(SERVER_KILLING, new ServerKillingMonkeyFactory())
+    .put(STRESS_AM, new StressAssignmentManagerMonkeyFactory())
     .build();
 
   public static MonkeyFactory getFactory(String factoryName) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/9d50488f/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/factories/StressAssignmentManagerMonkeyFactory.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/factories/StressAssignmentManagerMonkeyFactory.java
b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/factories/StressAssignmentManagerMonkeyFactory.java
new file mode 100644
index 0000000..ee50d2b
--- /dev/null
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/factories/StressAssignmentManagerMonkeyFactory.java
@@ -0,0 +1,64 @@
+package org.apache.hadoop.hbase.chaos.factories;
+
+import org.apache.hadoop.hbase.chaos.actions.Action;
+import org.apache.hadoop.hbase.chaos.actions.AddColumnAction;
+import org.apache.hadoop.hbase.chaos.actions.BatchRestartRsAction;
+import org.apache.hadoop.hbase.chaos.actions.CompactRandomRegionOfTableAction;
+import org.apache.hadoop.hbase.chaos.actions.CompactTableAction;
+import org.apache.hadoop.hbase.chaos.actions.DumpClusterStatusAction;
+import org.apache.hadoop.hbase.chaos.actions.FlushRandomRegionOfTableAction;
+import org.apache.hadoop.hbase.chaos.actions.FlushTableAction;
+import org.apache.hadoop.hbase.chaos.actions.MergeRandomAdjacentRegionsOfTableAction;
+import org.apache.hadoop.hbase.chaos.actions.MoveRandomRegionOfTableAction;
+import org.apache.hadoop.hbase.chaos.actions.MoveRegionsOfTableAction;
+import org.apache.hadoop.hbase.chaos.actions.RemoveColumnAction;
+import org.apache.hadoop.hbase.chaos.actions.RestartRandomRsAction;
+import org.apache.hadoop.hbase.chaos.actions.RestartRsHoldingMetaAction;
+import org.apache.hadoop.hbase.chaos.actions.RollingBatchRestartRsAction;
+import org.apache.hadoop.hbase.chaos.actions.SplitRandomRegionOfTableAction;
+import org.apache.hadoop.hbase.chaos.monkies.ChaosMonkey;
+import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey;
+import org.apache.hadoop.hbase.chaos.policies.CompositeSequentialPolicy;
+import org.apache.hadoop.hbase.chaos.policies.DoActionsOncePolicy;
+import org.apache.hadoop.hbase.chaos.policies.PeriodicRandomActionPolicy;
+
+public class StressAssignmentManagerMonkeyFactory extends MonkeyFactory {
+  @Override
+  public ChaosMonkey build() {
+
+    // Actions that could slow down region movement.
+    // These could also get regions stuck if there are issues.
+    Action[] actions1 = new Action[] {
+        new CompactTableAction(tableName, 0.5f),
+        new CompactRandomRegionOfTableAction(tableName, 0.6f),
+        new FlushTableAction(tableName),
+        new FlushRandomRegionOfTableAction(tableName)
+    };
+
+    Action[] actions2 = new Action[] {
+        new SplitRandomRegionOfTableAction(tableName),
+        new MergeRandomAdjacentRegionsOfTableAction(tableName),
+        new AddColumnAction(tableName),
+        new RemoveColumnAction(tableName, columnFamilies),
+        new MoveRegionsOfTableAction(800, 1600, tableName),
+        new MoveRandomRegionOfTableAction(800, tableName),
+        new RestartRandomRsAction(60000),
+        new BatchRestartRsAction(5000, 0.5f),
+        new RollingBatchRestartRsAction(5000, 1.0f),
+        new RestartRsHoldingMetaAction(35000)
+    };
+
+    // Action to log more info for debugging
+    Action[] actions3 = new Action[] {
+        new DumpClusterStatusAction()
+    };
+
+    return new PolicyBasedChaosMonkey(util,
+        new PeriodicRandomActionPolicy(90 * 1000, actions1),
+        new CompositeSequentialPolicy(
+            new DoActionsOncePolicy(90 * 1000, actions2),
+            new PeriodicRandomActionPolicy(90 * 1000, actions2)),
+        new PeriodicRandomActionPolicy(90 * 1000, actions3)
+    );
+  }
+}


Mime
View raw message