hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r1553717 - /hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/
Date Fri, 27 Dec 2013 18:57:32 GMT
Author: apurtell
Date: Fri Dec 27 18:57:32 2013
New Revision: 1553717

URL: http://svn.apache.org/r1553717
Log:
HBASE-10175. 2-thread ChaosMonkey steps on its own toes (Sergey Shelukhin)

Modified:
    hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java
    hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java
    hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java
    hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java
    hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java
    hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java
    hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java

Modified: hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java?rev=1553717&r1=1553716&r2=1553717&view=diff
==============================================================================
--- hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java
(original)
+++ hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java
Fri Dec 27 18:57:32 2013
@@ -66,12 +66,16 @@ public class CompactRandomRegionOfTableA
     HRegionInfo region = PolicyBasedChaosMonkey.selectRandomItem(
       regions.toArray(new HRegionInfo[regions.size()]));
 
-    if (major) {
-      LOG.debug("Major compacting region " + region.getRegionNameAsString());
-      admin.majorCompact(region.getRegionName());
-    } else {
-      LOG.debug("Compacting region " + region.getRegionNameAsString());
-      admin.compact(region.getRegionName());
+    try {
+      if (major) {
+        LOG.debug("Major compacting region " + region.getRegionNameAsString());
+        admin.majorCompact(region.getRegionName());
+      } else {
+        LOG.debug("Compacting region " + region.getRegionNameAsString());
+        admin.compact(region.getRegionName());
+      }
+    } catch (Exception ex) {
+      LOG.warn("Compaction failed, might be caused by other chaos: " + ex.getMessage());
     }
     if (sleepTime > 0) {
       Thread.sleep(sleepTime);

Modified: hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java?rev=1553717&r1=1553716&r2=1553717&view=diff
==============================================================================
--- hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java
(original)
+++ hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java
Fri Dec 27 18:57:32 2013
@@ -51,10 +51,14 @@ public class CompactTableAction extends 
     boolean major = RandomUtils.nextInt(100) < majorRatio;
 
     LOG.info("Performing action: Compact table " + tableName + ", major=" + major);
-    if (major) {
-      admin.majorCompact(tableNameBytes);
-    } else {
-      admin.compact(tableNameBytes);
+    try {
+      if (major) {
+        admin.majorCompact(tableNameBytes);
+      } else {
+        admin.compact(tableNameBytes);
+      }
+    } catch (Exception ex) {
+      LOG.warn("Compaction failed, might be caused by other chaos: " + ex.getMessage());
     }
     if (sleepTime > 0) {
       Thread.sleep(sleepTime);

Modified: hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java?rev=1553717&r1=1553716&r2=1553717&view=diff
==============================================================================
--- hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java
(original)
+++ hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java
Fri Dec 27 18:57:32 2013
@@ -59,7 +59,11 @@ public class FlushRandomRegionOfTableAct
     HRegionInfo region = PolicyBasedChaosMonkey.selectRandomItem(
       regions.toArray(new HRegionInfo[regions.size()]));
     LOG.debug("Flushing region " + region.getRegionNameAsString());
-    admin.flush(region.getRegionName());
+    try {
+      admin.flush(region.getRegionName());
+    } catch (Exception ex) {
+      LOG.warn("Flush failed, might be caused by other chaos: " + ex.getMessage());
+    }
     if (sleepTime > 0) {
       Thread.sleep(sleepTime);
     }

Modified: hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java?rev=1553717&r1=1553716&r2=1553717&view=diff
==============================================================================
--- hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java
(original)
+++ hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java
Fri Dec 27 18:57:32 2013
@@ -46,7 +46,11 @@ public class FlushTableAction extends Ac
     HBaseAdmin admin = util.getHBaseAdmin();
 
     LOG.info("Performing action: Flush table " + tableName);
-    admin.flush(tableNameBytes);
+    try {
+      admin.flush(tableNameBytes);
+    } catch (Exception ex) {
+      LOG.warn("Flush failed, might be caused by other chaos: " + ex.getMessage());
+    }
     if (sleepTime > 0) {
       Thread.sleep(sleepTime);
     }

Modified: hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java?rev=1553717&r1=1553716&r2=1553717&view=diff
==============================================================================
--- hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java
(original)
+++ hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java
Fri Dec 27 18:57:32 2013
@@ -60,7 +60,11 @@ public class MergeRandomAdjacentRegionsO
     HRegionInfo a = regions.get(i++);
     HRegionInfo b = regions.get(i);
     LOG.debug("Merging " + a.getRegionNameAsString() + " and " + b.getRegionNameAsString());
-    admin.mergeRegions(a.getEncodedNameAsBytes(), b.getEncodedNameAsBytes(), false);
+    try {
+      admin.mergeRegions(a.getEncodedNameAsBytes(), b.getEncodedNameAsBytes(), false);
+    } catch (Exception ex) {
+      LOG.warn("Merge failed, might be caused by other chaos: " + ex.getMessage());
+    }
     if (sleepTime > 0) {
       Thread.sleep(sleepTime);
     }

Modified: hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java?rev=1553717&r1=1553716&r2=1553717&view=diff
==============================================================================
--- hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java
(original)
+++ hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java
Fri Dec 27 18:57:32 2013
@@ -74,8 +74,8 @@ public class MoveRegionsOfTableAction ex
           servers[RandomUtils.nextInt(servers.length)].getServerName();
         LOG.debug("Moving " + regionInfo.getRegionNameAsString() + " to " + destServerName);
         admin.move(regionInfo.getEncodedNameAsBytes(), Bytes.toBytes(destServerName));
-      } catch (Exception e) {
-        LOG.debug("Error moving region", e);
+      } catch (Exception ex) {
+        LOG.warn("Move failed, might be caused by other chaos: " + ex.getMessage());
       }
       if (sleepTime > 0) {
         Thread.sleep(sleepTime);

Modified: hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java?rev=1553717&r1=1553716&r2=1553717&view=diff
==============================================================================
--- hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java
(original)
+++ hbase/branches/0.98/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java
Fri Dec 27 18:57:32 2013
@@ -59,7 +59,11 @@ public class SplitRandomRegionOfTableAct
     HRegionInfo region = PolicyBasedChaosMonkey.selectRandomItem(
         regions.toArray(new HRegionInfo[regions.size()]));
     LOG.debug("Splitting region " + region.getRegionNameAsString());
-    admin.split(region.getRegionName());
+    try {
+      admin.split(region.getRegionName());
+    } catch (Exception ex) {
+      LOG.warn("Split failed, might be caused by other chaos: " + ex.getMessage());
+    }
     if (sleepTime > 0) {
       Thread.sleep(sleepTime);
     }



Mime
View raw message