Browse Source

HDFS-2815. Namenode is not coming out of safemode when we perform ( NN crash + restart ). Also FSCK report shows blocks missed. (Contributed by Uma Maheswara Rao G)


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1378664 13f79535-47bb-0310-9956-ffa450edef68
Uma Maheswara Rao G 12 years ago
parent
commit
91f5024ffe

+ 3 - 0
CHANGES.txt

@@ -219,6 +219,9 @@ Release 1.2.0 - unreleased
     MAPREDUCE-1684. ClusterStatus can be cached in 
     MAPREDUCE-1684. ClusterStatus can be cached in 
     CapacityTaskScheduler.assignTasks() (Koji Noguchi via tgraves)
     CapacityTaskScheduler.assignTasks() (Koji Noguchi via tgraves)
 
 
+    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 - unreleased
 Release 1.1.0 - unreleased
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

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

@@ -2071,7 +2071,6 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean, FSClusterSt
    */
    */
   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()) {
@@ -2084,17 +2083,11 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean, FSClusterSt
       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