tasanuma commented on a change in pull request #2854:
URL: https://github.com/apache/hadoop/pull/2854#discussion_r608346819
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDecommission.java
##########
@@ -1587,4 +1587,50 @@ public Boolean get() {
cleanupFile(fileSys, file);
}
+
+ /**
+ * DataNodes with capacity 0 should be decommissioned immediately
+ * even if they haven't reported the first block report.
+ */
+ @Test(timeout=60000)
+ public void testCapacityZeroNodesDecommission() throws Exception {
+ int numNamenodes = 1;
+ int numDatanodes = 3;
+ startCluster(numNamenodes, numDatanodes);
+
+ // start 1 more datanode with capacity 0
+ int numOfNewDatanodes = 1;
+ int storagesPerDatanode = 2;
+ long[][] capacities = new long[numOfNewDatanodes][storagesPerDatanode];
+ for (int i = 0; i < numOfNewDatanodes; i++) {
+ for (int j = 0; j < storagesPerDatanode; j++) {
+ capacities[i][j] = 0;
+ }
+ }
+ getCluster().startDataNodes(getConf(), 1, null, true, null, null, null,
Review comment:
Thanks for your detailed reviews, @jojochuang. I will try to reproduce
it by a unit test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]