hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhang...@apache.org
Subject [04/50] hbase git commit: HBASE-19840 Flakey TestMetaWithReplicas; ADDENDUM Adding debug
Date Tue, 06 Feb 2018 12:46:53 GMT
HBASE-19840 Flakey TestMetaWithReplicas; ADDENDUM Adding debug


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

Branch: refs/heads/HBASE-19397-branch-2
Commit: a1600c1490f4260eedbb899a567e6c0063c5efb4
Parents: 29016bc
Author: Michael Stack <stack@apache.org>
Authored: Mon Feb 5 11:00:46 2018 -0800
Committer: Michael Stack <stack@apache.org>
Committed: Mon Feb 5 11:00:46 2018 -0800

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/TestServerName.java   | 13 +++++++++++++
 .../hadoop/hbase/client/TestMetaWithReplicas.java      | 11 ++++++++---
 2 files changed, 21 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/a1600c14/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerName.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerName.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerName.java
index a6e1401..2fdf542 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerName.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerName.java
@@ -22,6 +22,8 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertTrue;
 
+import java.util.HashSet;
+import java.util.Set;
 import java.util.regex.Pattern;
 import org.apache.hadoop.hbase.testclassification.MiscTests;
 import org.apache.hadoop.hbase.testclassification.SmallTests;
@@ -39,6 +41,17 @@ public class TestServerName {
       HBaseClassTestRule.forClass(TestServerName.class);
 
   @Test
+  public void testHash() {
+    ServerName sn1 = ServerName.parseServerName("asf903.gq1.ygridcore.net,52690,1517835491385");
+    ServerName sn2 = ServerName.parseServerName("asf903.gq1.ygridcore.net,42231,1517835491329");
+    Set<ServerName> sns = new HashSet<ServerName>();
+    sns.add(sn2);
+    sns.add(sn1);
+    sns.add(sn1);
+    assertEquals(2, sns.size());
+  }
+
+  @Test
   public void testGetHostNameMinusDomain() {
     assertEquals("2607:f0d0:1002:51::4",
       ServerName.getHostNameMinusDomain("2607:f0d0:1002:51::4"));

http://git-wip-us.apache.org/repos/asf/hbase/blob/a1600c14/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 ecd458d..2834d17 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
@@ -98,14 +98,19 @@ public class TestMetaWithReplicas {
     TEST_UTIL.startMiniCluster(REGIONSERVERS_COUNT);
     AssignmentManager am = TEST_UTIL.getMiniHBaseCluster().getMaster().getAssignmentManager();
     Set<ServerName> sns = new HashSet<ServerName>();
-    for (int replicaId = 0; replicaId < 3; replicaId ++) {
+    ServerName hbaseMetaServerName =
+        TEST_UTIL.getMiniHBaseCluster().getMaster().getMetaTableLocator().
+            getMetaRegionLocation(TEST_UTIL.getZooKeeperWatcher());
+    LOG.info("HBASE:META DEPLOY: on " + hbaseMetaServerName);
+    sns.add(hbaseMetaServerName);
+    for (int replicaId = 1; replicaId < 3; replicaId ++) {
       RegionInfo h =
           RegionReplicaUtil.getRegionInfoForReplica(RegionInfoBuilder.FIRST_META_REGIONINFO,
               replicaId);
       try {
         am.waitForAssignment(h);
         ServerName sn = am.getRegionStates().getRegionServerOfRegion(h);
-        LOG.info(h.getRegionNameAsString() + " on " + sn);
+        LOG.info("HBASE:META DEPLOY: " + h.getRegionNameAsString() + " on " + sn);
         sns.add(sn);
       } catch (NoSuchProcedureException e) {
         LOG.info("Presume the procedure has been cleaned up so just proceed: " + e.toString());
@@ -116,7 +121,7 @@ public class TestMetaWithReplicas {
     if (sns.size() == 1) {
       int count = TEST_UTIL.getMiniHBaseCluster().getLiveRegionServerThreads().size();
       assertTrue("count=" + count, count == REGIONSERVERS_COUNT);
-      LOG.warn("All hbase:meta replicas are on the one server; moving hbase:meta");
+      LOG.warn("All hbase:meta replicas are on the one server; moving hbase:meta: " + sns);
       int metaServerIndex = TEST_UTIL.getHBaseCluster().getServerWithMeta();
       int newServerIndex = metaServerIndex;
       while (newServerIndex == metaServerIndex) {


Mime
View raw message