hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tof...@apache.org
Subject [hbase] 05/09: test fixes
Date Wed, 05 Aug 2020 09:49:12 GMT
This is an automated email from the ASF dual-hosted git repository.

toffer pushed a commit to branch HBASE-11288.branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit fbfc8bb0588b4ae19db60dc1d2024de7f755c577
Author: Francis Liu <toffer@apache.org>
AuthorDate: Tue Aug 4 01:21:31 2020 -0700

    test fixes
---
 .../hadoop/hbase/client/TestClientNoCluster.java   | 28 +++++++++++-----------
 .../hadoop/hbase/rsgroup/TestRSGroupsBasics.java   |  4 ++--
 .../hadoop/hbase/TestClientClusterMetrics.java     | 20 ++++++++++++++--
 .../org/apache/hadoop/hbase/TestNamespace.java     |  1 +
 .../hbase/client/MetaWithReplicasTestBase.java     |  2 +-
 .../hadoop/hbase/master/AbstractTestDLS.java       |  6 ++---
 .../hbase/master/TestCatalogJanitorCluster.java    |  6 +++--
 .../hadoop/hbase/master/TestMasterMetrics.java     |  2 +-
 .../TestMasterRestartAfterDisablingTable.java      |  4 ++--
 .../apache/hadoop/hbase/master/TestMetaFixer.java  |  3 ++-
 .../hbase/master/TestMetaShutdownHandler.java      | 10 ++++----
 .../hadoop/hbase/master/TestRollingRestart.java    |  4 ++--
 ...tReportRegionStateTransitionFromDeadServer.java |  3 ++-
 .../TestReadAndWriteRegionInfoFile.java            |  2 +-
 .../regionserver/TestRegionServerMetrics.java      |  4 ++--
 15 files changed, 60 insertions(+), 39 deletions(-)

diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientNoCluster.java
b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientNoCluster.java
index aa21636..be3bc3b 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientNoCluster.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientNoCluster.java
@@ -220,7 +220,7 @@ public class TestClientNoCluster extends Configured implements Tool {
     this.conf.set("hbase.client.connection.impl",
       RegionServerStoppedOnScannerOpenConnection.class.getName());
     try (Connection connection = ConnectionFactory.createConnection(conf)) {
-      MetaTableAccessor.fullScanRegions(connection);
+      MetaTableAccessor.fullScanRegions(connection, TableName.ROOT_TABLE_NAME, null);
     }
   }
 
@@ -427,14 +427,14 @@ public class TestClientNoCluster extends Configured implements Tool
{
    */
   static class FakeServer implements ClientService.BlockingInterface {
     private AtomicInteger multiInvocationsCount = new AtomicInteger(0);
-    private final SortedMap<byte [], Pair<HRegionInfo, ServerName>> meta;
+    private final SortedMap<byte [], Pair<HRegionInfo, ServerName>> root;
     private final AtomicLong sequenceids;
     private final long multiPause;
     private final int tooManyMultiRequests;
 
-    FakeServer(final Configuration c, final SortedMap<byte [], Pair<HRegionInfo, ServerName>>
meta,
+    FakeServer(final Configuration c, final SortedMap<byte [], Pair<HRegionInfo, ServerName>>
root,
         final AtomicLong sequenceids) {
-      this.meta = meta;
+      this.root = root;
       this.sequenceids = sequenceids;
 
       // Pause to simulate the server taking time applying the edits.  This will drive up
the
@@ -446,12 +446,12 @@ public class TestClientNoCluster extends Configured implements Tool
{
     @Override
     public GetResponse get(RpcController controller, GetRequest request)
     throws ServiceException {
-      boolean metaRegion = isMetaRegion(request.getRegion().getValue().toByteArray(),
+      boolean rootRegion = isRootRegion(request.getRegion().getValue().toByteArray(),
         request.getRegion().getType());
-      if (!metaRegion) {
+      if (!rootRegion) {
         return doGetResponse(request);
       }
-      return doMetaGetResponse(meta, request);
+      return doRootGetResponse(root, request);
     }
 
     private GetResponse doGetResponse(GetRequest request) {
@@ -474,7 +474,7 @@ public class TestClientNoCluster extends Configured implements Tool {
         ScanRequest request) throws ServiceException {
       // Presume it is a scan of meta for now. Not all scans provide a region spec expecting
       // the server to keep reference by scannerid.  TODO.
-      return doMetaScanResponse(meta, sequenceids, request);
+      return doRootScanResponse(root, sequenceids, request);
     }
 
     @Override
@@ -501,7 +501,7 @@ public class TestClientNoCluster extends Configured implements Tool {
            concurrentInvocations));
         }
         Threads.sleep(multiPause);
-        return doMultiResponse(meta, sequenceids, request);
+        return doMultiResponse(root, sequenceids, request);
       } finally {
         this.multiInvocationsCount.decrementAndGet();
       }
@@ -526,7 +526,7 @@ public class TestClientNoCluster extends Configured implements Tool {
     }
   }
 
-  static ScanResponse doMetaScanResponse(final SortedMap<byte [], Pair<HRegionInfo,
ServerName>> meta,
+  static ScanResponse doRootScanResponse(final SortedMap<byte [], Pair<HRegionInfo,
ServerName>> meta,
       final AtomicLong sequenceids, final ScanRequest request) {
     ScanResponse.Builder builder = ScanResponse.newBuilder();
     int max = request.getNumberOfRows();
@@ -555,7 +555,7 @@ public class TestClientNoCluster extends Configured implements Tool {
     return builder.build();
   }
 
-  static GetResponse doMetaGetResponse(final SortedMap<byte [], Pair<HRegionInfo, ServerName>>
meta,
+  static GetResponse doRootGetResponse(final SortedMap<byte [], Pair<HRegionInfo, ServerName>>
meta,
       final GetRequest request) {
     ClientProtos.Result.Builder resultBuilder = ClientProtos.Result.newBuilder();
     ByteString row = request.getGet().getRow();
@@ -575,12 +575,12 @@ public class TestClientNoCluster extends Configured implements Tool
{
    * @param type
    * @return True if we are dealing with a hbase:meta region.
    */
-  static boolean isMetaRegion(final byte [] name, final RegionSpecifierType type) {
+  static boolean isRootRegion(final byte [] name, final RegionSpecifierType type) {
     switch (type) {
     case REGION_NAME:
-      return Bytes.equals(HRegionInfo.FIRST_META_REGIONINFO.getRegionName(), name);
+      return Bytes.equals(HRegionInfo.ROOT_REGIONINFO.getRegionName(), name);
     case ENCODED_REGION_NAME:
-      return Bytes.equals(HRegionInfo.FIRST_META_REGIONINFO.getEncodedNameAsBytes(), name);
+      return Bytes.equals(HRegionInfo.ROOT_REGIONINFO.getEncodedNameAsBytes(), name);
     default: throw new UnsupportedOperationException();
     }
   }
diff --git a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBasics.java
b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBasics.java
index 316a265..36257ff 100644
--- a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBasics.java
+++ b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBasics.java
@@ -88,8 +88,8 @@ public class TestRSGroupsBasics extends TestRSGroupsBase {
     assertEquals(NUM_SLAVES_BASE, defaultInfo.getServers().size());
     // Assignment of meta, namespace and rsgroup regions.
     int count = master.getAssignmentManager().getRegionStates().getRegionAssignments().size();
-    // 3 (meta, namespace and rsgroup)
-    assertEquals(3, count);
+    // 4 (room,t meta, namespace and rsgroup)
+    assertEquals(4, count);
   }
 
   @Test
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterMetrics.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterMetrics.java
index 7fabf2a..db2bb9d 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterMetrics.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterMetrics.java
@@ -283,7 +283,8 @@ public class TestClientClusterMetrics {
     waitForUsersMetrics(1);
     long writeMetaMetricForUserFoo =
         getMetaMetrics().getWriteRequestCount() - writeMetaMetricBeforeNextuser;
-    long readMetaMetricBeforeNextuser = getMetaMetrics().getReadRequestCount();
+    long readMetaMetricBeforeNextuser =
+      getRootMetrics().getReadRequestCount() + getMetaMetrics().getReadRequestCount();
     userBar.runAs(new PrivilegedAction<Void>() {
       @Override public Void run() {
         try {
@@ -296,7 +297,8 @@ public class TestClientClusterMetrics {
     });
     waitForUsersMetrics(2);
     long readMetaMetricForUserBar =
-        getMetaMetrics().getReadRequestCount() - readMetaMetricBeforeNextuser;
+        getRootMetrics().getReadRequestCount() +
+          getMetaMetrics().getReadRequestCount() - readMetaMetricBeforeNextuser;
     long filteredMetaReqeust = getMetaMetrics().getFilteredReadRequestCount();
     userTest.runAs(new PrivilegedAction<Void>() {
       @Override public Void run() {
@@ -345,6 +347,20 @@ public class TestClientClusterMetrics {
     UTIL.deleteTable(TABLE_NAME);
   }
 
+
+  private RegionMetrics getRootMetrics() throws IOException {
+    for (ServerMetrics serverMetrics : ADMIN.getClusterMetrics(EnumSet.of(Option.LIVE_SERVERS))
+      .getLiveServerMetrics().values()) {
+      RegionMetrics rootMetrics = serverMetrics.getRegionMetrics()
+        .get(RegionInfoBuilder.ROOT_REGIONINFO.getRegionName());
+      if (rootMetrics != null) {
+        return rootMetrics;
+      }
+    }
+    Assert.fail("Should have find root metrics");
+    return null;
+  }
+
   private RegionMetrics getMetaMetrics() throws IOException {
     for (ServerMetrics serverMetrics : ADMIN.getClusterMetrics(EnumSet.of(Option.LIVE_SERVERS))
         .getLiveServerMetrics().values()) {
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java
index e0df715..d379bfe 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java
@@ -119,6 +119,7 @@ public class TestNamespace {
 
     //verify existence of system tables
     Set<TableName> systemTables = Sets.newHashSet(
+        TableName.ROOT_TABLE_NAME,
         TableName.META_TABLE_NAME,
         TableName.NAMESPACE_TABLE_NAME);
     HTableDescriptor[] descs =
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/MetaWithReplicasTestBase.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/MetaWithReplicasTestBase.java
index 78e3e54..12a3d1c 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/MetaWithReplicasTestBase.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/MetaWithReplicasTestBase.java
@@ -65,7 +65,7 @@ public class MetaWithReplicasTestBase {
     AssignmentManager am = TEST_UTIL.getMiniHBaseCluster().getMaster().getAssignmentManager();
     Set<ServerName> sns = new HashSet<ServerName>();
     ServerName hbaseMetaServerName =
-      MetaTableLocator.getMetaRegionLocation(TEST_UTIL.getZooKeeperWatcher());
+      MetaTableLocator.getRootRegionLocation(TEST_UTIL.getZooKeeperWatcher());
     LOG.info("HBASE:META DEPLOY: on " + hbaseMetaServerName);
     sns.add(hbaseMetaServerName);
     for (int replicaId = 1; replicaId < 3; replicaId++) {
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/AbstractTestDLS.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/AbstractTestDLS.java
index 2b91ba9..5b8abca 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/AbstractTestDLS.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/AbstractTestDLS.java
@@ -503,18 +503,18 @@ public abstract class AbstractTestDLS {
     blockUntilNoRIT();
     NavigableSet<String> regions = HBaseTestingUtility.getAllOnlineRegions(cluster);
     LOG.debug("Verifying only catalog and namespace regions are assigned\n");
-    if (regions.size() != 2) {
+    if (regions.size() != 3) {
       for (String oregion : regions)
         LOG.debug("Region still online: " + oregion);
     }
-    assertEquals(2 + existingRegions, regions.size());
+    assertEquals(3 + existingRegions, regions.size());
     LOG.debug("Enabling table\n");
     TEST_UTIL.getAdmin().enableTable(tableName);
     LOG.debug("Waiting for no more RIT\n");
     blockUntilNoRIT();
     LOG.debug("Verifying there are " + numRegions + " assigned on cluster\n");
     regions = HBaseTestingUtility.getAllOnlineRegions(cluster);
-    assertEquals(numRegions + 2 + existingRegions, regions.size());
+    assertEquals(numRegions + 3 + existingRegions, regions.size());
     return table;
   }
 
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitorCluster.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitorCluster.java
index 2bc88bf..3c0d14f 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitorCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitorCluster.java
@@ -192,7 +192,8 @@ public class TestCatalogJanitorCluster {
       setStartKey("a".getBytes()).
       setEndKey("cc".getBytes()).build();
     Put putForT4 = MetaTableAccessor.makePutFromRegionInfo(newRiT4, System.currentTimeMillis());
-    MetaTableAccessor.putsToMetaTable(TEST_UTIL.getConnection(), Arrays.asList(putForT4));
+    MetaTableAccessor.putsToCatalogTable(TEST_UTIL.getConnection(),
+      TableName.META_TABLE_NAME, Arrays.asList(putForT4));
 
     janitor.scan();
     report = janitor.getLastReport();
@@ -215,7 +216,8 @@ public class TestCatalogJanitorCluster {
       setStartKey("a".getBytes()).
       setEndKey("g".getBytes()).build();
     Put putForT5 = MetaTableAccessor.makePutFromRegionInfo(newRiT5, System.currentTimeMillis());
-    MetaTableAccessor.putsToMetaTable(TEST_UTIL.getConnection(), Arrays.asList(putForT5));
+    MetaTableAccessor.putsToCatalogTable(TEST_UTIL.getConnection(),
+      TableName.META_TABLE_NAME, Arrays.asList(putForT5));
 
     janitor.scan();
     report = janitor.getLastReport();
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetrics.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetrics.java
index 6dc9b42..0927796 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetrics.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetrics.java
@@ -137,7 +137,7 @@ public class TestMasterMetrics {
     MetricsMasterSource masterSource = master.getMasterMetrics().getMetricsSource();
     boolean tablesOnMaster = LoadBalancer.isTablesOnMaster(TEST_UTIL.getConfiguration());
     metricsHelper.assertGauge( "numRegionServers",1 + (tablesOnMaster? 1: 0), masterSource);
-    metricsHelper.assertGauge( "averageLoad", 1 + (tablesOnMaster? 0: 1), masterSource);
+    metricsHelper.assertGauge( "averageLoad", 1 + (tablesOnMaster? 0: 2), masterSource);
     metricsHelper.assertGauge( "numDeadRegionServers", 0, masterSource);
 
     metricsHelper.assertGauge("masterStartTime", master.getMasterStartTime(), masterSource);
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java
index 665e5c6..c92a797 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java
@@ -93,7 +93,7 @@ public class TestMasterRestartAfterDisablingTable {
     NavigableSet<String> regions = HBaseTestingUtility.getAllOnlineRegions(cluster);
     assertEquals(
         "The number of regions for the table tableRestart should be 0 and only"
-            + "the catalog and namespace tables should be present.", 2, regions.size());
+            + "the catalog and namespace tables should be present.", 3, regions.size());
 
     List<MasterThread> masterThreads = cluster.getMasterThreads();
     MasterThread activeMaster = null;
@@ -122,7 +122,7 @@ public class TestMasterRestartAfterDisablingTable {
     regions = HBaseTestingUtility.getAllOnlineRegions(cluster);
     assertEquals("The assigned regions were not onlined after master"
         + " switch except for the catalog and namespace tables.",
-          6, regions.size());
+          7, regions.size());
     assertTrue("The table should be in enabled state",
         cluster.getMaster().getTableStateManager()
         .isTableState(TableName.valueOf(name.getMethodName()), TableState.State.ENABLED));
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMetaFixer.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMetaFixer.java
index 25fe069..8998127 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMetaFixer.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMetaFixer.java
@@ -354,7 +354,8 @@ public class TestMetaFixer {
       setStartKey(overlapRegion.getStartKey()).
       build();
 
-    Table meta = MetaTableAccessor.getMetaHTable(TEST_UTIL.getConnection());
+    Table meta =
+      MetaTableAccessor.getCatalogHTable(TEST_UTIL.getConnection(), TableName.META_TABLE_NAME);
     Put putOfMerged = MetaTableAccessor.makePutFromRegionInfo(overlapRegion,
       HConstants.LATEST_TIMESTAMP);
     String qualifier = String.format(HConstants.MERGE_QUALIFIER_PREFIX_STR + "%04d", 0);
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMetaShutdownHandler.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMetaShutdownHandler.java
index 43c4de4..6157f8d 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMetaShutdownHandler.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMetaShutdownHandler.java
@@ -87,16 +87,16 @@ public class TestMetaShutdownHandler {
     HMaster master = cluster.getMaster();
     RegionStates regionStates = master.getAssignmentManager().getRegionStates();
     ServerName metaServerName = regionStates.getRegionServerOfRegion(
-      HRegionInfo.FIRST_META_REGIONINFO);
+      HRegionInfo.ROOT_REGIONINFO);
     if (master.getServerName().equals(metaServerName) || metaServerName == null
         || !metaServerName.equals(cluster.getServerHoldingMeta())) {
       // Move meta off master
       metaServerName =
           cluster.getLiveRegionServerThreads().get(0).getRegionServer().getServerName();
-      master.move(HRegionInfo.FIRST_META_REGIONINFO.getEncodedNameAsBytes(),
+      master.move(HRegionInfo.ROOT_REGIONINFO.getEncodedNameAsBytes(),
         Bytes.toBytes(metaServerName.getServerName()));
       TEST_UTIL.waitUntilNoRegionsInTransition(60000);
-      metaServerName = regionStates.getRegionServerOfRegion(HRegionInfo.FIRST_META_REGIONINFO);
+      metaServerName = regionStates.getRegionServerOfRegion(HRegionInfo.ROOT_REGIONINFO);
     }
     RegionState metaState = MetaTableLocator.getRootRegionState(master.getZooKeeper());
     assertEquals("Wrong state for meta!", RegionState.State.OPEN, metaState.getState());
@@ -123,13 +123,13 @@ public class TestMetaShutdownHandler {
     TEST_UTIL.waitUntilNoRegionsInTransition(60000);
     // Now, make sure meta is assigned
     assertTrue("Meta should be assigned",
-      regionStates.isRegionOnline(HRegionInfo.FIRST_META_REGIONINFO));
+      regionStates.isRegionOnline(HRegionInfo.ROOT_REGIONINFO));
     // Now, make sure meta is registered in zk
     metaState = MetaTableLocator.getRootRegionState(master.getZooKeeper());
     assertEquals("Meta should not be in transition", RegionState.State.OPEN,
         metaState.getState());
     assertEquals("Meta should be assigned", metaState.getServerName(),
-      regionStates.getRegionServerOfRegion(HRegionInfo.FIRST_META_REGIONINFO));
+      regionStates.getRegionServerOfRegion(HRegionInfo.ROOT_REGIONINFO));
     assertNotEquals("Meta should be assigned on a different server",
       metaState.getServerName(), metaServerName);
   }
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
index 7530121..178a91a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
@@ -116,10 +116,10 @@ public class TestRollingRestart {
     TEST_UTIL.waitUntilNoRegionsInTransition(60000);
     NavigableSet<String> regions = HBaseTestingUtility.getAllOnlineRegions(cluster);
     log("Verifying only catalog and namespace regions are assigned\n");
-    if (regions.size() != 2) {
+    if (regions.size() != 3) {
       for (String oregion : regions) log("Region still online: " + oregion);
     }
-    assertEquals(2, regions.size());
+    assertEquals(3, regions.size());
     log("Enabling table\n");
     TEST_UTIL.getAdmin().enableTable(tableName);
     log("Waiting for no more RIT\n");
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestReportRegionStateTransitionFromDeadServer.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestReportRegionStateTransitionFromDeadServer.java
index 1de806f..3f3f881 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestReportRegionStateTransitionFromDeadServer.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestReportRegionStateTransitionFromDeadServer.java
@@ -103,7 +103,8 @@ public class TestReportRegionStateTransitionFromDeadServer {
     public ReportRegionStateTransitionResponse reportRegionStateTransition(
         ReportRegionStateTransitionRequest req) throws PleaseHoldException {
       if (ARRIVE_REPORT != null && req.getTransitionList().stream()
-        .allMatch(t -> !ProtobufUtil.toRegionInfo(t.getRegionInfo(0)).isMetaRegion()))
{
+        .allMatch(t -> !ProtobufUtil.toRegionInfo(t.getRegionInfo(0)).isRootRegion() &&
+          !ProtobufUtil.toRegionInfo(t.getRegionInfo(0)).isMetaRegion())) {
         ARRIVE_REPORT.countDown();
         try {
           RESUME_REPORT.await();
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReadAndWriteRegionInfoFile.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReadAndWriteRegionInfoFile.java
index 103fb73..219d77e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReadAndWriteRegionInfoFile.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReadAndWriteRegionInfoFile.java
@@ -71,7 +71,7 @@ public class TestReadAndWriteRegionInfoFile {
     RegionInfo ri = RegionInfoBuilder.FIRST_META_REGIONINFO;
     // Create a region. That'll write the .regioninfo file.
     FSTableDescriptors fsTableDescriptors = new FSTableDescriptors(FS, ROOT_DIR);
-    FSTableDescriptors.tryUpdateMetaTableDescriptor(CONF, FS, ROOT_DIR, null);
+    FSTableDescriptors.tryUpdateCatalogTableDescriptor(CONF, FS, ROOT_DIR, null);
     HRegion r = HBaseTestingUtility.createRegionAndWAL(ri, ROOT_DIR, CONF,
       fsTableDescriptors.get(TableName.META_TABLE_NAME));
     // Get modtime on the file.
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java
index 4cae2ae..ad7838a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java
@@ -240,7 +240,7 @@ public class TestRegionServerMetrics {
 
   @Test
   public void testRegionCount() throws Exception {
-    metricsHelper.assertGauge("regionCount", TABLES_ON_MASTER? 1: 3, serverSource);
+    metricsHelper.assertGauge("regionCount", TABLES_ON_MASTER? 1: 4, serverSource);
   }
 
   @Test
@@ -350,7 +350,7 @@ public class TestRegionServerMetrics {
     TEST_UTIL.getAdmin().flush(tableName);
 
     metricsRegionServer.getRegionServerWrapper().forceRecompute();
-    assertGauge("storeCount", TABLES_ON_MASTER ? 1 : 5);
+    assertGauge("storeCount", TABLES_ON_MASTER ? 1 : 8);
     assertGauge("storeFileCount", 1);
   }
 


Mime
View raw message