Explorar el Código

HDFS-2815. Merging r1378664 from branch-1

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.1@1406854 13f79535-47bb-0310-9956-ffa450edef68
Suresh Srinivas hace 12 años
padre
commit
11acd4f87e

+ 3 - 0
CHANGES.txt

@@ -16,6 +16,9 @@ Release 1.1.1 - Unreleased
     directory deletion completes. It allows other operations when the 
     directory deletion completes. It allows other operations when the 
     deletion is in progress. (umamahesh via suresh)
     deletion is in progress. (umamahesh via suresh)
 
 
+    HDFS-2815. Namenode is not coming out of safemode when we perform ( NN crash + restart ). 
+    Also FSCK report shows blocks missed. (umamahesh)
+
 Release 1.1.0 - 2012.09.28
 Release 1.1.0 - 2012.09.28
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 1 - 8
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

@@ -2081,7 +2081,6 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean,
    */
    */
   private boolean deleteInternal(String src,
   private boolean deleteInternal(String src,
       boolean enforcePermission) throws IOException {
       boolean enforcePermission) throws IOException {
-    boolean deleteNow = false;
     ArrayList<Block> collectedBlocks = new ArrayList<Block>();
     ArrayList<Block> collectedBlocks = new ArrayList<Block>();
     synchronized (this) {
     synchronized (this) {
       if (isInSafeMode()) {
       if (isInSafeMode()) {
@@ -2094,17 +2093,11 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean,
       if (!dir.delete(src, collectedBlocks)) {
       if (!dir.delete(src, collectedBlocks)) {
         return false;
         return false;
       }
       }
-      deleteNow = collectedBlocks.size() <= BLOCK_DELETION_INCREMENT;
-      if (deleteNow) { // Perform small deletes right away
-        removeBlocks(collectedBlocks);
-      }
     }
     }
     
     
     // Log directory deletion to editlog
     // Log directory deletion to editlog
     getEditLog().logSync();
     getEditLog().logSync();
-    if (!deleteNow) {
-      removeBlocks(collectedBlocks); // Incremental deletion of blocks
-    }
+    removeBlocks(collectedBlocks); // Incremental deletion of blocks
     collectedBlocks.clear();
     collectedBlocks.clear();
     if (NameNode.stateChangeLog.isDebugEnabled()) {
     if (NameNode.stateChangeLog.isDebugEnabled()) {
       NameNode.stateChangeLog.debug("DIR* Namesystem.delete: " + src
       NameNode.stateChangeLog.debug("DIR* Namesystem.delete: " + src