From 87cd58b0f9817d2ec790d91b7240be3faae2f2ed Mon Sep 17 00:00:00 2001 From: Suresh Srinivas Date: Mon, 13 Feb 2012 20:19:23 +0000 Subject: [PATCH] HDFS-2815. Merging change r1243673 from trunk to 0.23. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1243674 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../apache/hadoop/hdfs/server/namenode/FSNamesystem.java | 9 +-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 40d727c06ff..bd7c5851469 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -29,6 +29,9 @@ Release 0.23.2 - UNRELEASED HDFS-776. Fix exception handling in Balancer. (Uma Maheswara Rao G via szetszwo) + HDFS-2815. Namenode sometimes oes not come out of safemode during + NN crash + restart. (Uma Maheswara Rao via suresh) + Release 0.23.1 - 2012-02-08 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index cf71d59985e..8b15aca7e8f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -1908,7 +1908,6 @@ public class FSNamesystem implements Namesystem, FSClusterStats, boolean enforcePermission) throws AccessControlException, SafeModeException, UnresolvedLinkException, IOException { - boolean deleteNow = false; ArrayList collectedBlocks = new ArrayList(); writeLock(); @@ -1926,10 +1925,6 @@ public class FSNamesystem implements Namesystem, FSClusterStats, if (!dir.delete(src, collectedBlocks)) { return false; } - deleteNow = collectedBlocks.size() <= BLOCK_DELETION_INCREMENT; - if (deleteNow) { // Perform small deletes right away - removeBlocks(collectedBlocks); - } } finally { writeUnlock(); } @@ -1938,9 +1933,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats, writeLock(); try { - if (!deleteNow) { - removeBlocks(collectedBlocks); // Incremental deletion of blocks - } + removeBlocks(collectedBlocks); // Incremental deletion of blocks } finally { writeUnlock(); }