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-16527 IOExceptions from DFS client still can cause CatalogJanitor to delete referenced files (Vladimir Rodionov)
Date Thu, 01 Sep 2016 19:49:22 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 e792d570a -> c8da39429


HBASE-16527 IOExceptions from DFS client still can cause CatalogJanitor to delete referenced
files (Vladimir Rodionov)


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

Branch: refs/heads/0.98
Commit: c8da39429c8ff79971af9117691add17639f2bbb
Parents: e792d57
Author: tedyu <yuzhihong@gmail.com>
Authored: Thu Sep 1 12:49:13 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Thu Sep 1 12:49:13 2016 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/master/CatalogJanitor.java     | 20 ++++++++++----------
 .../hbase/regionserver/HRegionFileSystem.java   | 15 ++++++++++++---
 2 files changed, 22 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c8da3942/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
index ea67dd2..8e6c675 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
@@ -380,27 +380,27 @@ public class CatalogJanitor extends Chore {
         return new Pair<Boolean, Boolean>(Boolean.FALSE, Boolean.FALSE);
       }
     } catch (IOException ioe) {
-      LOG.warn("Error trying to determine if daughter region exists, " +
+      LOG.error("Error trying to determine if daughter region exists, " +
                "assuming exists and has references", ioe);
       return new Pair<Boolean, Boolean>(Boolean.TRUE, Boolean.TRUE);
     }
 
+    boolean references = false;
+    HTableDescriptor parentDescriptor = getTableDescriptor(parent.getTable());
     try {
       regionFs = HRegionFileSystem.openRegionFromFileSystem(
           this.services.getConfiguration(), fs, tabledir, daughter, true);
+      
+      for (HColumnDescriptor family: parentDescriptor.getFamilies()) {
+        if ((references = regionFs.hasReferences(family.getNameAsString()))) {
+          break;
+        }
+      }
     } catch (IOException e) {
-      LOG.warn("Error trying to determine referenced files from : " + daughter.getEncodedName()
+      LOG.error("Error trying to determine referenced files from : " + daughter.getEncodedName()
           + ", to: " + parent.getEncodedName() + " assuming has references", e);
       return new Pair<Boolean, Boolean>(Boolean.TRUE, Boolean.TRUE);
     }
-
-    boolean references = false;
-    HTableDescriptor parentDescriptor = getTableDescriptor(parent.getTable());
-    for (HColumnDescriptor family: parentDescriptor.getFamilies()) {
-      if ((references = regionFs.hasReferences(family.getNameAsString()))) {
-        break;
-      }
-    }
     return new Pair<Boolean, Boolean>(Boolean.TRUE, Boolean.valueOf(references));
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/c8da3942/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
index 828e815..e941d78 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
@@ -240,9 +240,18 @@ public class HRegionFileSystem {
    * @throws IOException
    */
   public boolean hasReferences(final String familyName) throws IOException {
-    FileStatus[] files = FSUtils.listStatus(fs, getStoreDir(familyName),
-        new FSUtils.ReferenceFileFilter(fs));
-    return files != null && files.length > 0;
+    FileStatus[] files = FSUtils.listStatus(fs, getStoreDir(familyName));
+    if (files != null) {
+      for(FileStatus stat: files) {
+        if(stat.isDirectory()) {
+          continue;
+        }
+        if(StoreFileInfo.isReference(stat.getPath())) {
+          return true;
+        }
+      }
+    }
+    return false;
   }
 
   /**


Mime
View raw message