hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From este...@apache.org
Subject hbase git commit: HBASE-18362 hbck should not report split replica parent region from meta as errors (Huaxiang Sun)
Date Thu, 27 Jul 2017 21:03:10 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.4 9914d28df -> 615a67799


HBASE-18362 hbck should not report split replica parent region from meta as errors (Huaxiang
Sun)

Signed-off-by: Esteban Gutierrez <esteban@apache.org>


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

Branch: refs/heads/branch-1.4
Commit: 615a677994d3491d4e6d8b445502a2d819d29cdb
Parents: 9914d28
Author: Esteban Gutierrez <esteban@apache.org>
Authored: Thu Jul 27 15:59:07 2017 -0500
Committer: Esteban Gutierrez <esteban@apache.org>
Committed: Thu Jul 27 16:00:14 2017 -0500

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/util/HBaseFsck.java | 10 ++++++++
 .../apache/hadoop/hbase/util/TestHBaseFsck.java | 25 ++++++++++++++++++++
 2 files changed, 35 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/615a6779/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
index 0c491e2..e5e4b5a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
@@ -2440,6 +2440,16 @@ public class HBaseFsck extends Configured implements Closeable {
           return;
         }
       }
+
+      // For Replica region, we need to do a similar check. If replica is not split successfully,
+      // error is going to be reported against primary daughter region.
+      if (hbi.getReplicaId() != HRegionInfo.DEFAULT_REPLICA_ID) {
+        LOG.info("Region " + descriptiveName + " is a split parent in META, in HDFS, "
+            + "and not deployed on any region server. This may be transient.");
+        hbi.setSkipChecks(true);
+        return;
+      }
+
       errors.reportError(ERROR_CODE.LINGERING_SPLIT_PARENT, "Region "
           + descriptiveName + " is a split parent in META, in HDFS, "
           + "and not deployed on any region server. This could be transient, "

http://git-wip-us.apache.org/repos/asf/hbase/blob/615a6779/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
index c0102de..f1dc1a2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
@@ -210,6 +210,31 @@ public class TestHBaseFsck {
     EnvironmentEdgeManager.reset();
   }
 
+  /*
+ * This creates a table with region_replica > 1, do a split, check
+ * that hbck will not report split replica parent as lingering split parent
+ */
+  @Test public void testHbckReportReplicaLingeringSplitParent() throws Exception {
+    TableName table = TableName.valueOf("testHbckReportReplicaLingeringSplitParent");
+
+    try {
+      setupTableWithRegionReplica(table, 2);
+      TEST_UTIL.getHBaseAdmin().flush(table.getName());
+
+      // disable catalog janitor
+      TEST_UTIL.getHBaseAdmin().enableCatalogJanitor(false);
+      admin.split(table, Bytes.toBytes("A1"));
+
+      Thread.sleep(1000);
+      // run hbck again to make sure we don't see any errors
+      assertNoErrors(doFsck(conf, false));
+    } finally {
+      cleanupTable(table);
+      // enable catalog janitor
+      TEST_UTIL.getHBaseAdmin().enableCatalogJanitor(true);
+    }
+  }
+
   @Test (timeout=180000)
   public void testHBaseFsck() throws Exception {
     assertNoErrors(doFsck(conf, false));


Mime
View raw message