hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-15126 HBaseFsck's checkRegionBoundaries function sets incorrect storesFirstKey (chenrongwei)
Date Thu, 21 Jan 2016 15:47:10 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 4bf6f8379 -> 1d2b0d831


HBASE-15126 HBaseFsck's checkRegionBoundaries function sets incorrect storesFirstKey (chenrongwei)


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

Branch: refs/heads/master
Commit: 1d2b0d831117e033aebf0b347b162c4483a04e5d
Parents: 4bf6f83
Author: tedyu <yuzhihong@gmail.com>
Authored: Thu Jan 21 07:46:58 2016 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Thu Jan 21 07:46:58 2016 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/util/HBaseFsck.java |  2 +-
 .../hadoop/hbase/util/TestHBaseFsckOneRS.java   | 24 ++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/1d2b0d83/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 c066803..ca7bc81 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
@@ -795,7 +795,7 @@ public class HBaseFsck extends Configured implements Closeable {
         }
         currentRegionBoundariesInformation.metaFirstKey = regionInfo.getStartKey();
         currentRegionBoundariesInformation.metaLastKey = regionInfo.getEndKey();
-        currentRegionBoundariesInformation.storesFirstKey = storeFirstKey;
+        currentRegionBoundariesInformation.storesFirstKey = keyOnly(storeFirstKey);
         currentRegionBoundariesInformation.storesLastKey = keyOnly(storeLastKey);
         if (currentRegionBoundariesInformation.metaFirstKey.length == 0)
           currentRegionBoundariesInformation.metaFirstKey = null;

http://git-wip-us.apache.org/repos/asf/hbase/blob/1d2b0d83/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
index 21935f3..1593e6c 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
@@ -580,6 +580,30 @@ public class TestHBaseFsckOneRS extends BaseTestHBaseFsck {
     }
   }
 
+  /**
+   * test region boundaries and make sure store file had been created.
+   * @throws Exception
+   */
+  @Test(timeout = 180000)
+  public void testRegionBoundariesCheckWithFlushTable() throws Exception {
+    HBaseFsck hbck = doFsck(conf, false);
+    assertNoErrors(hbck); // no errors
+    TableName table = TableName.valueOf("testRegionBoundariesCheckWithFlushTable");
+    try {
+      setupTable(table);
+      admin.flush(table);
+      hbck.connect(); // need connection to have access to META
+      hbck.checkRegionBoundaries();
+      assertNoErrors(hbck); // no errors
+    } catch (IllegalArgumentException e) {
+      if (e.getMessage().endsWith("not a valid DFS filename.")) {
+        fail("Table directory path is not valid." + e.getMessage());
+      }
+    } finally {
+      hbck.close();
+    }
+  }
+  
   @Test (timeout=180000)
   public void testHbckAfterRegionMerge() throws Exception {
     TableName table = TableName.valueOf("testMergeRegionFilesInHdfs");


Mime
View raw message