Repository: hbase
Updated Branches:
  refs/heads/branch-1 91d03697d -> abfb20206


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/abfb2020
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/abfb2020
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/abfb2020

Branch: refs/heads/branch-1
Commit: abfb20206d59dbbe3d85b2d1ced44b61fd37d58c
Parents: 91d0369
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:53:01 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/abfb2020/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 92aed7c..c115e7b 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
@@ -638,7 +638,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();
@@ -756,8 +755,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.
@@ -773,8 +776,6 @@ public class HBaseFsck extends Configured implements 
Closeable {
       checkRegionBoundaries();
     }
 
-    offlineReferenceFileRepair();
-
     checkAndFixTableLocks();
 
     // Check (and fix if requested) orphaned table ZNodes
@@ -1079,6 +1080,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