Parcourir la source

HADOOP-2159. Name node should not decrment blockSafe for invalid blocks. Contributed by Hairong Kuang.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@661912 13f79535-47bb-0310-9956-ffa450edef68
Hairong Kuang il y a 17 ans
Parent
commit
c23501e8a1
2 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 3 0
      CHANGES.txt
  2. 1 1
      src/java/org/apache/hadoop/dfs/FSNamesystem.java

+ 3 - 0
CHANGES.txt

@@ -359,6 +359,9 @@ Trunk (unreleased changes)
 
 
     HADOOP-3401. Update FileBench to set the new
     HADOOP-3401. Update FileBench to set the new
     "mapred.work.output.dir" property to work post-3041. (cdouglas via omalley)
     "mapred.work.output.dir" property to work post-3041. (cdouglas via omalley)
+
+    HADOOP-2159 Namenode stuck in safemode. The counter blockSafe should
+    not be decremented for invalid blocks. (hairong)
  
  
 Release 0.17.0 - 2008-05-18
 Release 0.17.0 - 2008-05-18
 
 

+ 1 - 1
src/java/org/apache/hadoop/dfs/FSNamesystem.java

@@ -2926,7 +2926,6 @@ class FSNamesystem implements FSConstants, FSNamesystemMBean {
       return;
       return;
     }
     }
         
         
-    decrementSafeBlockCount(block);
     //
     //
     // It's possible that the block was removed because of a datanode
     // It's possible that the block was removed because of a datanode
     // failure.  If the block is still valid, check if replication is
     // failure.  If the block is still valid, check if replication is
@@ -2935,6 +2934,7 @@ class FSNamesystem implements FSConstants, FSNamesystemMBean {
     //
     //
     INode fileINode = blocksMap.getINode(block);
     INode fileINode = blocksMap.getINode(block);
     if (fileINode != null) {
     if (fileINode != null) {
+      decrementSafeBlockCount(block);
       updateNeededReplications(block, -1, 0);
       updateNeededReplications(block, -1, 0);
     }
     }