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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]