jojochuang commented on a change in pull request #2854:
URL: https://github.com/apache/hadoop/pull/2854#discussion_r608323737



##########
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:
       IMO a more complete repro of the scenario should include:
   1. start DN with volumes, update config to tolerate volume failures.
   2. intentionally corrupt the volumes (delete VERSION file, for example)
   3. trigger volume scanner, wait for the DN to drop the volume
   
   Maybe we don't need a very faithful repro, but I am worried this test 
doesn't cover the real scenario.




-- 
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to