You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/04/13 09:26:51 UTC

[GitHub] [hadoop] Hexiaoqiao commented on a diff in pull request #4077: HDFS-16509. Fix decommission UnsupportedOperationException

Hexiaoqiao commented on code in PR #4077:
URL: https://github.com/apache/hadoop/pull/4077#discussion_r849274680


##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDecommission.java:
##########
@@ -673,6 +675,36 @@ public void testDecommissionWithOpenfile()
     fdos.close();
   }
 
+  @Test(timeout = 20000)
+  public void testDecommissionWithUnknownBlock() throws IOException {
+    startCluster(1, 3);
+
+    FSNamesystem ns = getCluster().getNamesystem(0);
+    DatanodeManager datanodeManager = ns.getBlockManager().getDatanodeManager();
+
+    BlockInfo blk = new BlockInfoContiguous(new Block(1L), (short) 1);
+    DatanodeDescriptor dn = datanodeManager.getDatanodes().iterator().next();
+    dn.getStorageInfos()[0].addBlock(blk, blk);
+
+    datanodeManager.getDatanodeAdminManager().startDecommission(dn);
+    waitNodeDecommissioned(dn);
+  }
+
+  private void waitNodeDecommissioned(DatanodeInfo node) {

Review Comment:
   Hi @cndaimin, I think we could invoke this method rather than add new one, what do you think about?https://github.com/apache/hadoop/blob/45394433a112334e48087bd60674538af739922a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/AdminStatesBaseTest.java#L332



-- 
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.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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