hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject svn commit: r1195870 - in /hadoop/common/branches/branch-0.22/hdfs: CHANGES.txt src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSafeMode.java
Date Tue, 01 Nov 2011 08:39:33 GMT
Author: shv
Date: Tue Nov  1 08:39:33 2011
New Revision: 1195870

URL: http://svn.apache.org/viewvc?rev=1195870&view=rev
Log:
HDFS-2002. Incorrect computation of needed blocks in getTurnOffTip(). Contributed by Plamen
Jeliazkov.

Modified:
    hadoop/common/branches/branch-0.22/hdfs/CHANGES.txt
    hadoop/common/branches/branch-0.22/hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
    hadoop/common/branches/branch-0.22/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSafeMode.java

Modified: hadoop/common/branches/branch-0.22/hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.22/hdfs/CHANGES.txt?rev=1195870&r1=1195869&r2=1195870&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.22/hdfs/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.22/hdfs/CHANGES.txt Tue Nov  1 08:39:33 2011
@@ -656,6 +656,9 @@ Release 0.22.0 - Unreleased
     HDFS-2491. TestBalancer can fail when datanode utilization and 
     avgUtilization is exactly same. (Uma Maheswara Rao G via shv)
 
+    HDFS-2002. Incorrect computation of needed blocks in getTurnOffTip().
+    (Plamen Jeliazkov via shv)
+
 Release 0.21.1 - Unreleased
 
   IMPROVEMENTS

Modified: hadoop/common/branches/branch-0.22/hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.22/hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java?rev=1195870&r1=1195869&r2=1195870&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.22/hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
(original)
+++ hadoop/common/branches/branch-0.22/hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
Tue Nov  1 08:39:33 2011
@@ -3842,6 +3842,9 @@ public class FSNamesystem implements FSC
      */
     SafeModeInfo(Configuration conf) {
       this.threshold = conf.getFloat(DFSConfigKeys.DFS_NAMENODE_SAFEMODE_THRESHOLD_PCT_KEY,
DFSConfigKeys.DFS_NAMENODE_SAFEMODE_THRESHOLD_PCT_DEFAULT);
+      if(threshold > 1.0) {
+    	  LOG.warn("The threshold value should't be greater than 1, threshold: " + threshold);
+      }
       this.datanodeThreshold = conf.getInt(
         DFSConfigKeys.DFS_NAMENODE_SAFEMODE_MIN_DATANODES_KEY,
         DFSConfigKeys.DFS_NAMENODE_SAFEMODE_MIN_DATANODES_DEFAULT);
@@ -4054,7 +4057,7 @@ public class FSNamesystem implements FSC
           msg += String.format(
             "The reported blocks %d needs additional %d"
             + " blocks to reach the threshold %.4f of total blocks %d.",
-            blockSafe, (blockThreshold - blockSafe), threshold, blockTotal);
+            blockSafe, (blockThreshold - blockSafe) + 1, threshold, blockTotal);
         }
         if (numLive < datanodeThreshold) {
           if (!"".equals(msg)) {
@@ -4063,7 +4066,7 @@ public class FSNamesystem implements FSC
           msg += String.format(
             "The number of live datanodes %d needs an additional %d live "
             + "datanodes to reach the minimum number %d.",
-            numLive, datanodeThreshold - numLive, datanodeThreshold);
+            numLive, (datanodeThreshold - numLive) + 1 , datanodeThreshold);
         }
         msg += " " + leaveMsg;
       } else {

Modified: hadoop/common/branches/branch-0.22/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSafeMode.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.22/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSafeMode.java?rev=1195870&r1=1195869&r2=1195870&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.22/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSafeMode.java
(original)
+++ hadoop/common/branches/branch-0.22/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSafeMode.java
Tue Nov  1 08:39:33 2011
@@ -58,8 +58,9 @@ public class TestSafeMode {
 
       String tipMsg = cluster.getNamesystem().getSafeModeTip();
       assertTrue("Safemode tip message looks right",
-                 tipMsg.contains("The number of live datanodes 0 needs an " +
-                                 "additional 1 live"));
+                 tipMsg.contains("The number of live datanodes 0 needs an additional " +
+                                 "2 live datanodes to reach the minimum number 1. " +
+                                 "Safe mode will be turned off automatically."));
 
       // Start a datanode
       cluster.startDataNodes(conf, 1, true, null, null);



Mime
View raw message