[ 
https://issues.apache.org/jira/browse/HDFS-16509?focusedWorklogId=756281&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-756281
 ]

ASF GitHub Bot logged work on HDFS-16509:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Apr/22 09:39
            Start Date: 13/Apr/22 09:39
    Worklog Time Spent: 10m 
      Work Description: cndaimin commented on code in PR #4077:
URL: https://github.com/apache/hadoop/pull/4077#discussion_r849286228


##########
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:
   Yes, we can use this method, updated. Thanks a lot! @Hexiaoqiao 





Issue Time Tracking
-------------------

    Worklog Id:     (was: 756281)
    Time Spent: 2h 20m  (was: 2h 10m)

> Fix decommission UnsupportedOperationException: Remove unsupported
> ------------------------------------------------------------------
>
>                 Key: HDFS-16509
>                 URL: https://issues.apache.org/jira/browse/HDFS-16509
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>    Affects Versions: 3.3.1, 3.3.2
>            Reporter: daimin
>            Assignee: daimin
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> We encountered an "UnsupportedOperationException: Remove unsupported" error 
> when some datanodes were in decommission. The reason of the exception is that 
> datanode.getBlockIterator() returns anĀ Iterator does not support remove, 
> however DatanodeAdminDefaultMonitor#processBlocksInternal invokesĀ it.remove() 
> when a block not found, e.g, the file containing the block is deleted.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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

Reply via email to