HDFS-7497. Inconsistent report of decommissioning DataNodes between dfsadmin and NameNode webui. Contributed by Yongjun Zhang.
This commit is contained in:
parent
5b9fcedb4d
commit
b437f5eef4
|
@ -576,6 +576,9 @@ Release 2.7.0 - UNRELEASED
|
||||||
|
|
||||||
HDFS-7515. Fix new findbugs warnings in hadoop-hdfs. (wheat9)
|
HDFS-7515. Fix new findbugs warnings in hadoop-hdfs. (wheat9)
|
||||||
|
|
||||||
|
HDFS-7497. Inconsistent report of decommissioning DataNodes between
|
||||||
|
dfsadmin and NameNode webui. (Yongjun Zhang via wang)
|
||||||
|
|
||||||
Release 2.6.1 - UNRELEASED
|
Release 2.6.1 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -1112,16 +1112,8 @@ public class DatanodeManager {
|
||||||
public List<DatanodeDescriptor> getDecommissioningNodes() {
|
public List<DatanodeDescriptor> getDecommissioningNodes() {
|
||||||
// There is no need to take namesystem reader lock as
|
// There is no need to take namesystem reader lock as
|
||||||
// getDatanodeListForReport will synchronize on datanodeMap
|
// getDatanodeListForReport will synchronize on datanodeMap
|
||||||
final List<DatanodeDescriptor> decommissioningNodes
|
// A decommissioning DN may be "alive" or "dead".
|
||||||
= new ArrayList<DatanodeDescriptor>();
|
return getDatanodeListForReport(DatanodeReportType.DECOMMISSIONING);
|
||||||
final List<DatanodeDescriptor> results = getDatanodeListForReport(
|
|
||||||
DatanodeReportType.LIVE);
|
|
||||||
for(DatanodeDescriptor node : results) {
|
|
||||||
if (node.isDecommissionInProgress()) {
|
|
||||||
decommissioningNodes.add(node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return decommissioningNodes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Getter and Setter for stale DataNodes related attributes */
|
/* Getter and Setter for stale DataNodes related attributes */
|
||||||
|
|
|
@ -239,10 +239,10 @@ public class TestDecommissioningStatus {
|
||||||
System.setOut(oldOut);
|
System.setOut(oldOut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests Decommissioning Status in DFS.
|
* Tests Decommissioning Status in DFS.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDecommissionStatus() throws IOException, InterruptedException {
|
public void testDecommissionStatus() throws IOException, InterruptedException {
|
||||||
InetSocketAddress addr = new InetSocketAddress("localhost", cluster
|
InetSocketAddress addr = new InetSocketAddress("localhost", cluster
|
||||||
|
@ -351,6 +351,11 @@ public class TestDecommissioningStatus {
|
||||||
assertTrue("the node should be DECOMMISSION_IN_PROGRESSS",
|
assertTrue("the node should be DECOMMISSION_IN_PROGRESSS",
|
||||||
dead.get(0).isDecommissionInProgress());
|
dead.get(0).isDecommissionInProgress());
|
||||||
|
|
||||||
|
// Check DatanodeManager#getDecommissionNodes, make sure it returns
|
||||||
|
// the node as decommissioning, even if it's dead
|
||||||
|
List<DatanodeDescriptor> decomlist = dm.getDecommissioningNodes();
|
||||||
|
assertTrue("The node should be be decommissioning", decomlist.size() == 1);
|
||||||
|
|
||||||
// Delete the under-replicated file, which should let the
|
// Delete the under-replicated file, which should let the
|
||||||
// DECOMMISSION_IN_PROGRESS node become DECOMMISSIONED
|
// DECOMMISSION_IN_PROGRESS node become DECOMMISSIONED
|
||||||
cleanupFile(fileSys, f);
|
cleanupFile(fileSys, f);
|
||||||
|
|
Loading…
Reference in New Issue