HDFS-2002. Incorrect computation of needed blocks in getTurnOffTip(). Contributed by Plamen Jeliazkov.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1195869 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a3a4ccfed7
commit
22000ce96d
@ -1833,6 +1833,9 @@ Release 0.22.0 - Unreleased
|
|||||||
HDFS-2285. BackupNode should reject requests to modify namespace.
|
HDFS-2285. BackupNode should reject requests to modify namespace.
|
||||||
(shv and Uma Maheswara Rao)
|
(shv and Uma Maheswara Rao)
|
||||||
|
|
||||||
|
HDFS-2002. Incorrect computation of needed blocks in getTurnOffTip().
|
||||||
|
(Plamen Jeliazkov via shv)
|
||||||
|
|
||||||
Release 0.21.1 - Unreleased
|
Release 0.21.1 - Unreleased
|
||||||
|
|
||||||
HDFS-1466. TestFcHdfsSymlink relies on /tmp/test not existing. (eli)
|
HDFS-1466. TestFcHdfsSymlink relies on /tmp/test not existing. (eli)
|
||||||
|
@ -2883,6 +2883,9 @@ class SafeModeInfo {
|
|||||||
private SafeModeInfo(Configuration conf) {
|
private SafeModeInfo(Configuration conf) {
|
||||||
this.threshold = conf.getFloat(DFS_NAMENODE_SAFEMODE_THRESHOLD_PCT_KEY,
|
this.threshold = conf.getFloat(DFS_NAMENODE_SAFEMODE_THRESHOLD_PCT_KEY,
|
||||||
DFS_NAMENODE_SAFEMODE_THRESHOLD_PCT_DEFAULT);
|
DFS_NAMENODE_SAFEMODE_THRESHOLD_PCT_DEFAULT);
|
||||||
|
if(threshold > 1.0) {
|
||||||
|
LOG.warn("The threshold value should't be greater than 1, threshold: " + threshold);
|
||||||
|
}
|
||||||
this.datanodeThreshold = conf.getInt(
|
this.datanodeThreshold = conf.getInt(
|
||||||
DFS_NAMENODE_SAFEMODE_MIN_DATANODES_KEY,
|
DFS_NAMENODE_SAFEMODE_MIN_DATANODES_KEY,
|
||||||
DFS_NAMENODE_SAFEMODE_MIN_DATANODES_DEFAULT);
|
DFS_NAMENODE_SAFEMODE_MIN_DATANODES_DEFAULT);
|
||||||
@ -3170,7 +3173,7 @@ String getTurnOffTip() {
|
|||||||
msg += String.format(
|
msg += String.format(
|
||||||
"The reported blocks %d needs additional %d"
|
"The reported blocks %d needs additional %d"
|
||||||
+ " blocks to reach the threshold %.4f of total blocks %d.",
|
+ " blocks to reach the threshold %.4f of total blocks %d.",
|
||||||
blockSafe, (blockThreshold - blockSafe), threshold, blockTotal);
|
blockSafe, (blockThreshold - blockSafe) + 1, threshold, blockTotal);
|
||||||
}
|
}
|
||||||
if (numLive < datanodeThreshold) {
|
if (numLive < datanodeThreshold) {
|
||||||
if (!"".equals(msg)) {
|
if (!"".equals(msg)) {
|
||||||
@ -3179,7 +3182,7 @@ String getTurnOffTip() {
|
|||||||
msg += String.format(
|
msg += String.format(
|
||||||
"The number of live datanodes %d needs an additional %d live "
|
"The number of live datanodes %d needs an additional %d live "
|
||||||
+ "datanodes to reach the minimum number %d.",
|
+ "datanodes to reach the minimum number %d.",
|
||||||
numLive, datanodeThreshold - numLive, datanodeThreshold);
|
numLive, (datanodeThreshold - numLive) + 1 , datanodeThreshold);
|
||||||
}
|
}
|
||||||
msg += " " + leaveMsg;
|
msg += " " + leaveMsg;
|
||||||
} else {
|
} else {
|
||||||
|
@ -58,8 +58,9 @@ public void testDatanodeThreshold() throws IOException {
|
|||||||
|
|
||||||
String tipMsg = cluster.getNamesystem().getSafeModeTip();
|
String tipMsg = cluster.getNamesystem().getSafeModeTip();
|
||||||
assertTrue("Safemode tip message looks right",
|
assertTrue("Safemode tip message looks right",
|
||||||
tipMsg.contains("The number of live datanodes 0 needs an " +
|
tipMsg.contains("The number of live datanodes 0 needs an additional " +
|
||||||
"additional 1 live"));
|
"2 live datanodes to reach the minimum number 1. " +
|
||||||
|
"Safe mode will be turned off automatically."));
|
||||||
|
|
||||||
// Start a datanode
|
// Start a datanode
|
||||||
cluster.startDataNodes(conf, 1, true, null, null);
|
cluster.startDataNodes(conf, 1, true, null, null);
|
||||||
|
Loading…
Reference in New Issue
Block a user