You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2011/10/31 19:09:59 UTC

svn commit: r1195589 - in /hbase/branches/0.92: CHANGES.txt src/main/java/org/apache/hadoop/hbase/util/FSUtils.java

Author: stack
Date: Mon Oct 31 18:09:58 2011
New Revision: 1195589

URL: http://svn.apache.org/viewvc?rev=1195589&view=rev
Log:
HBASE-4680 FSUtils.isInSafeMode() checks should operate on HBase root dir, where we have permissions; REVERT

Modified:
    hbase/branches/0.92/CHANGES.txt
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java

Modified: hbase/branches/0.92/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/CHANGES.txt?rev=1195589&r1=1195588&r2=1195589&view=diff
==============================================================================
--- hbase/branches/0.92/CHANGES.txt (original)
+++ hbase/branches/0.92/CHANGES.txt Mon Oct 31 18:09:58 2011
@@ -386,8 +386,6 @@ Release 0.92.0 - Unreleased
    HBASE-4679  Thrift null mutation error
    HBASE-4304  requestsPerSecond counter stuck at 0 (Li Pi)
    HBASE-4692  HBASE-4300 broke the build
-   HBASE-4680  FSUtils.isInSafeMode() checks should operate on HBase root dir,
-               where we have permissions
    HBASE-4641  Block cache can be mistakenly instantiated on Master (jgray)
    HBASE-4687  regionserver may miss zk-heartbeats to master when replaying
                edits at region open (prakash via jgray)

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java?rev=1195589&r1=1195588&r2=1195589&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java Mon Oct 31 18:09:58 2011
@@ -156,16 +156,16 @@ public abstract class FSUtils {
    * @return true if dfs is in safemode, false otherwise.
    *
    */
-  private static boolean isInSafeMode(FileSystem fs, Path rootDir)
-      throws IOException {
+  private static boolean isInSafeMode(FileSystem fs) throws IOException {
     // Refactored safe-mode check for HBASE-4510
     if (fs instanceof DistributedFileSystem) {
-      FsPermission rootPerm = fs.getFileStatus(rootDir).getPermission();
+      Path rootPath = new Path("/");
+      FsPermission rootPerm = fs.getFileStatus(rootPath).getPermission();
       try {
         // Should be harmless to set back the path we retrieved.
         // The first check server-side is the safemode, so if
         // other exceptions are spewed out, we're not interested.
-        fs.setPermission(rootDir, rootPerm);
+        fs.setPermission(rootPath, rootPerm);
       } catch (SafeModeException e) {
         return true;
       }
@@ -180,9 +180,8 @@ public abstract class FSUtils {
    */
   public static void checkDfsSafeMode(final Configuration conf) 
   throws IOException {
-    Path rootDir = getRootDir(conf);
     FileSystem fs = FileSystem.get(conf);
-    if (isInSafeMode(fs, rootDir)) {
+    if (isInSafeMode(fs)) {
       throw new IOException("File system is in safemode, it can't be written now");
     }
   }
@@ -452,10 +451,9 @@ public abstract class FSUtils {
   public static void waitOnSafeMode(final Configuration conf,
     final long wait)
   throws IOException {
-    Path rootDir = getRootDir(conf);
     FileSystem fs = FileSystem.get(conf);
     // Make sure dfs is not in safe mode
-    while (isInSafeMode(fs, rootDir)) {
+    while (isInSafeMode(fs)) {
       LOG.info("Waiting for dfs to exit safe mode...");
       try {
         Thread.sleep(wait);