hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhang...@apache.org
Subject [16/34] hbase git commit: HBASE-19840 Flakey TestMetaWithReplicas
Date Wed, 24 Jan 2018 09:50:58 GMT
HBASE-19840 Flakey TestMetaWithReplicas

Adding debuging


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

Branch: refs/heads/HBASE-19064
Commit: d49357f2652ef730a3dcbd40a8b0eb7e2174626a
Parents: b577fa0
Author: Michael Stack <stack@apache.org>
Authored: Mon Jan 22 12:24:52 2018 -0800
Committer: Michael Stack <stack@apache.org>
Committed: Mon Jan 22 12:28:56 2018 -0800

----------------------------------------------------------------------
 .../hadoop/hbase/client/TestMetaWithReplicas.java  | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d49357f2/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java
index ce908c0..2e4c6c6 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java
@@ -30,6 +30,8 @@ import java.util.Collection;
 import java.util.EnumSet;
 import java.util.List;
 import java.util.concurrent.ExecutorService;
+import java.util.concurrent.atomic.AtomicBoolean;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.Abortable;
 import org.apache.hadoop.hbase.CategoryBasedTimeout;
@@ -93,14 +95,14 @@ public class TestMetaWithReplicas {
     // disable the balancer
     LoadBalancerTracker l = new LoadBalancerTracker(TEST_UTIL.getZooKeeperWatcher(),
         new Abortable() {
-      boolean aborted = false;
+      AtomicBoolean aborted = new AtomicBoolean(false);
       @Override
       public boolean isAborted() {
-        return aborted;
+        return aborted.get();
       }
       @Override
       public void abort(String why, Throwable e) {
-        aborted = true;
+        aborted.set(true);
       }
     });
     l.setBalancerOn(false);
@@ -174,6 +176,7 @@ public class TestMetaWithReplicas {
         conf.get("zookeeper.znode.metaserver", "meta-region-server"));
     byte[] data = ZKUtil.getData(zkw, primaryMetaZnode);
     ServerName primary = ProtobufUtil.toServerName(data);
+    LOG.info("Primary=" + primary.toString());
 
     TableName TABLE = TableName.valueOf("testShutdownHandling");
     byte[][] FAMILIES = new byte[][] { Bytes.toBytes("foo") };
@@ -208,14 +211,17 @@ public class TestMetaWithReplicas {
         master = util.getHBaseClusterInterface().getClusterMetrics().getMasterName();
         // kill the master so that regionserver recovery is not triggered at all
         // for the meta server
+        LOG.info("Stopping master=" + master.toString());
         util.getHBaseClusterInterface().stopMaster(master);
         util.getHBaseClusterInterface().waitForMasterToStop(master, 60000);
+        LOG.info("Master stopped!");
         if (!master.equals(primary)) {
           util.getHBaseClusterInterface().killRegionServer(primary);
           util.getHBaseClusterInterface().waitForRegionServerToStop(primary, 60000);
         }
         ((ClusterConnection)c).clearRegionCache();
       }
+      LOG.info("Running GETs");
       Get get = null;
       Result r = null;
       byte[] row = "test".getBytes();
@@ -231,13 +237,16 @@ public class TestMetaWithReplicas {
         assertTrue(Arrays.equals(r.getRow(), row));
         // now start back the killed servers and disable use of replicas. That would mean
         // calls go to the primary
+        LOG.info("Starting Master");
         util.getHBaseClusterInterface().startMaster(master.getHostname(), 0);
         util.getHBaseClusterInterface().startRegionServer(primary.getHostname(), 0);
         util.getHBaseClusterInterface().waitForActiveAndReadyMaster();
+        LOG.info("Master active!");
         ((ClusterConnection)c).clearRegionCache();
       }
       conf.setBoolean(HConstants.USE_META_REPLICAS, false);
-      try (Table htable = c.getTable(TABLE)) {
+      LOG.info("Running GETs no replicas");
+      try (Table htable = c.getTable(TABLE);) {
         r = htable.get(get);
         assertTrue(Arrays.equals(r.getRow(), row));
       }


Mime
View raw message