From 2584779166f0095bc26cb0bdb3fb0701c943dafe Mon Sep 17 00:00:00 2001 From: Tsz-wo Sze Date: Wed, 25 Apr 2012 19:34:36 +0000 Subject: [PATCH] HDFS-3321. Fix safe mode turn off tip message. Contributed by Ravi Prakash git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1330506 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | 2 +- .../src/test/java/org/apache/hadoop/hdfs/TestSafeMode.java | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index ad5b9aa9d7..074a16a915 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -901,6 +901,8 @@ Release 0.23.3 - UNRELEASED HDFS-3318. Use BoundedInputStream in ByteRangeInputStream, otherwise, it hangs on transfers >2 GB. (Daryn Sharp via szetszwo) + HDFS-3321. Fix safe mode turn off tip message. (Ravi Prakash via szetszwo) + Release 0.23.2 - UNRELEASED 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 beab87447c..c92ee852e4 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 @@ -3723,7 +3723,7 @@ String getTurnOffTip() { msg += String.format( "The number of live datanodes %d needs an additional %d live " + "datanodes to reach the minimum number %d.", - numLive, (datanodeThreshold - numLive) + 1 , datanodeThreshold); + numLive, (datanodeThreshold - numLive), datanodeThreshold); } msg += " " + leaveMsg; } else { diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestSafeMode.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestSafeMode.java index 3c25a61e72..3da68643d7 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestSafeMode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestSafeMode.java @@ -342,7 +342,7 @@ public void testDatanodeThreshold() throws IOException { String tipMsg = cluster.getNamesystem().getSafemode(); assertTrue("Safemode tip message looks right: " + tipMsg, tipMsg.contains("The number of live datanodes 0 needs an additional " + - "2 live datanodes to reach the minimum number 1. " + + "1 live datanodes to reach the minimum number 1. " + "Safe mode will be turned off automatically.")); // Start a datanode