Repository: hbase
Updated Branches:
  refs/heads/master 22dcce571 -> 66821206b


HBASE-16647 hbck should do offline reference repair before online repair


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

Branch: refs/heads/master
Commit: 66821206b85d85fba3012d6bb0d6b98c8ee23cb8
Parents: 22dcce5
Author: Jerry He <jerry...@apache.org>
Authored: Tue Sep 20 11:49:09 2016 -0700
Committer: Jerry He <jerry...@apache.org>
Committed: Tue Sep 20 11:49:09 2016 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/util/HBaseFsck.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/66821206/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 d483c71..6a56f8e 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
@@ -630,7 +630,6 @@ public class HBaseFsck extends Configured implements 
Closeable {
    */
   public int onlineConsistencyRepair() throws IOException, KeeperException,
     InterruptedException {
-    clearState();
 
     // get regions according to what is online on each RegionServer
     loadDeployedRegions();
@@ -748,8 +747,12 @@ public class HBaseFsck extends Configured implements 
Closeable {
       throws IOException, KeeperException, InterruptedException, 
ServiceException {
     // print hbase server version
     errors.print("Version: " + status.getHBaseVersion());
-    offlineHdfsIntegrityRepair();
 
+    // Clean start
+    clearState();
+    // Do offline check and repair first
+    offlineHdfsIntegrityRepair();
+    offlineReferenceFileRepair();
     // If Master runs maintenance tasks (such as balancer, catalog janitor, 
etc) during online
     // hbck, it is likely that hbck would be misled and report transient 
errors.  Therefore, it
     // is better to set Master into maintenance mode during online hbck.
@@ -765,8 +768,6 @@ public class HBaseFsck extends Configured implements 
Closeable {
       checkRegionBoundaries();
     }
 
-    offlineReferenceFileRepair();
-
     checkAndFixTableLocks();
 
     checkAndFixReplication();
@@ -1068,6 +1069,7 @@ public class HBaseFsck extends Configured implements 
Closeable {
    * be fixed before a cluster can start properly.
    */
   private void offlineReferenceFileRepair() throws IOException, 
InterruptedException {
+    clearState();
     Configuration conf = getConf();
     Path hbaseRoot = FSUtils.getRootDir(conf);
     FileSystem fs = hbaseRoot.getFileSystem(conf);

Reply via email to