You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by sa...@apache.org on 2019/09/12 00:36:11 UTC

[hbase] branch branch-1.3 updated: [HBASE-23000] Backport HBASE-18150 to branch-1.3 to fix consistently failing tests (#608)

This is an automated email from the ASF dual-hosted git repository.

sakthi pushed a commit to branch branch-1.3
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-1.3 by this push:
     new 009882b  [HBASE-23000] Backport HBASE-18150 to branch-1.3 to fix consistently failing tests (#608)
009882b is described below

commit 009882b31c38d0d3c696f3e6b0defc6c0fc31144
Author: shahrs87 <sh...@gmail.com>
AuthorDate: Wed Sep 11 17:36:05 2019 -0700

    [HBASE-23000] Backport HBASE-18150 to branch-1.3 to fix consistently failing tests (#608)
    
    Fixes - TestLogRollAbort, TestBlockReorder, TestHRegionServerBulkLoad, TestMasterFileSystemWithWALDir
    
    Signed-off-by: Sakthi <sa...@apache.org>
---
 .../hadoop/hbase/master/MasterFileSystem.java      | 43 +++++++++++++++-------
 1 file changed, 29 insertions(+), 14 deletions(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
index 9654b2f..c7b683c 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
@@ -469,16 +469,24 @@ public class MasterFileSystem {
         } else {
           fs.mkdirs(rd);
         }
-        // DFS leaves safe mode with 0 DNs when there are 0 blocks.
-        // We used to handle this by checking the current DN count and waiting until
-        // it is nonzero. With security, the check for datanode count doesn't work --
-        // it is a privileged op. So instead we adopt the strategy of the jobtracker
-        // and simply retry file creation during bootstrap indefinitely. As soon as
-        // there is one datanode it will succeed. Permission problems should have
-        // already been caught by mkdirs above.
-        FSUtils.setVersion(fs, rd, c.getInt(HConstants.THREAD_WAKE_FREQUENCY,
-          10 * 1000), c.getInt(HConstants.VERSION_FILE_WRITE_ATTEMPTS,
-            HConstants.DEFAULT_VERSION_FILE_WRITE_ATTEMPTS));
+
+        // HBASE-17437 updates createInitialFileSystemLayout() to re-use checkRootDir()
+        // to check hbase.wal.dir after checking hbase.rootdir.
+        // But FSUtils.setVersion() is supposed to be called only when checking hbase.rootdir,
+        // while it is supposed to be bypassed when checking hbase.wal.dir.
+        if (dirConfKey.equals(HConstants.HBASE_DIR)) {
+          // DFS leaves safe mode with 0 DNs when there are 0 blocks.
+          // We used to handle this by checking the current DN count and waiting until
+          // it is nonzero. With security, the check for datanode count doesn't work --
+          // it is a privileged op. So instead we adopt the strategy of the jobtracker
+          // and simply retry file creation during bootstrap indefinitely. As soon as
+          // there is one datanode it will succeed. Permission problems should have
+          // already been caught by mkdirs above.
+          FSUtils.setVersion(fs, rd,
+            c.getInt(HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000),
+            c.getInt(HConstants.VERSION_FILE_WRITE_ATTEMPTS,
+                HConstants.DEFAULT_VERSION_FILE_WRITE_ATTEMPTS));
+        }
       } else {
         if (!fs.isDirectory(rd)) {
           throw new IllegalArgumentException(rd.toString() + " is not a directory");
@@ -493,10 +501,17 @@ public class MasterFileSystem {
               + "and restarting the master");
           fs.setPermission(rd, dirPerms);
         }
-        // as above
-        FSUtils.checkVersion(fs, rd, true, c.getInt(HConstants.THREAD_WAKE_FREQUENCY,
-          10 * 1000), c.getInt(HConstants.VERSION_FILE_WRITE_ATTEMPTS,
-            HConstants.DEFAULT_VERSION_FILE_WRITE_ATTEMPTS));
+
+        // HBASE-17437 updates createInitialFileSystemLayout() to re-use checkRootDir()
+        // to check hbase.wal.dir after checking hbase.rootdir.
+        // But FSUtils.checkVersion() is supposed to be called only when checking hbase.rootdir,
+        // while it is supposed to be bypassed when checking hbase.wal.dir.
+        if (dirConfKey.equals(HConstants.HBASE_DIR)) {
+          FSUtils.checkVersion(fs, rd, true,
+            c.getInt(HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000),
+            c.getInt(HConstants.VERSION_FILE_WRITE_ATTEMPTS,
+                HConstants.DEFAULT_VERSION_FILE_WRITE_ATTEMPTS));
+        }
       }
     } catch (DeserializationException de) {
       LOG.fatal("Please fix invalid configuration for " + dirConfKey, de);