You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Yiqun Lin (JIRA)" <ji...@apache.org> on 2019/01/29 08:43:00 UTC

[jira] [Comment Edited] (HDDS-1024) Handle DeleteContainerCommand in the SCMDatanodeProtocolServer

    [ https://issues.apache.org/jira/browse/HDDS-1024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16754696#comment-16754696 ] 

Yiqun Lin edited comment on HDDS-1024 at 1/29/19 8:42 AM:
----------------------------------------------------------

Almost looks good to me, [~bharatviswa]! Only one comment from me:
{noformat}
+    // Take first node from the datanode list, and close the container (As we
+    // have only three, the container will be created on three nodes)
+    // We need to close the container because delete container only happens
+    // on closed containers.
+    DatanodeDetails datanodeDetails =
+        cluster.getHddsDatanodes().get(0).getDatanodeDetails();
+    //send the order to close the container
+    cluster.getStorageContainerManager().getScmNodeManager()
+        .addDatanodeCommand(datanodeDetails.getUuid(),
+            new CloseContainerCommand(containerId.getId(), pipeline.getId()));
{noformat}
I think we can add an additional check for the deleting container behaviour for not-closed node (.e.g. here send cmd to node1). It's expected to throw a SCM exception.

Functions {{isContainerClosed(long containerID)}}, {{isContainerDeleted(long containerID)}} 
 can be refactored to 
 {{isContainerClosed(HddsDatanodeService node, long containerID)}}, {{isContainerDeleted(HddsDatanodeService node, long containerID)}}.
 Also can we complete the javadoc of these two functions?


was (Author: linyiqun):
Almost looks good to me, [~bharatviswa]! Only one comment from me:
{noformat}
+    // Take first node from the datanode list, and close the container (As we
+    // have only three, the container will be created on three nodes)
+    // We need to close the container because delete container only happens
+    // on closed containers.
+    DatanodeDetails datanodeDetails =
+        cluster.getHddsDatanodes().get(0).getDatanodeDetails();
+    //send the order to close the container
+    cluster.getStorageContainerManager().getScmNodeManager()
+        .addDatanodeCommand(datanodeDetails.getUuid(),
+            new CloseContainerCommand(containerId.getId(), pipeline.getId()));
{noformat}
I think we can add an additional check for the deleting container behaviour for not-closed node (.e.g. here send cmd to node1). It's expected to throw a SCM exception.

Functions {{isContainerClosed(long containerID)}}, {{isContainerDeleted(long containerID)}} 
 can be refactored to 
 {{isContainerClosed(HddsDatanodeService node, long containerID)}}, {{isContainerDeleted(HddsDatanodeService node, long containerID)}}.

> Handle DeleteContainerCommand in the SCMDatanodeProtocolServer
> --------------------------------------------------------------
>
>                 Key: HDDS-1024
>                 URL: https://issues.apache.org/jira/browse/HDDS-1024
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>            Reporter: Bharat Viswanadham
>            Assignee: Bharat Viswanadham
>            Priority: Major
>              Labels: SCM
>         Attachments: HDDS-1024.00.patch, HDDS-1024.01.patch
>
>
> Right now, in the SCMDatanodeProtocolServer getCommandResponse() deleteContainerCommand is not handled, so deleteContainerCommand is not sent to Datanode.
>  
> The deletecontainercommand request is sent for over replicated containers, so this over replication is currently broken because of this.
>  
> Because of this we see below error:
>  
> {code:java}
> java.lang.IllegalArgumentException: Not implemented
>  at org.apache.hadoop.hdds.scm.server.SCMDatanodeProtocolServer.getCommandResponse(SCMDatanodeProtocolServer.java:345)
>  at org.apache.hadoop.hdds.scm.server.SCMDatanodeProtocolServer.sendHeartbeat(SCMDatanodeProtocolServer.java:272)
>  at org.apache.hadoop.ozone.protocolPB.StorageContainerDatanodeProtocolServerSideTranslatorPB.sendHeartbeat(StorageContainerDatanodeProtocolServerSideTranslatorPB.java:88)
>  at org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos$StorageContainerDatanodeProtocolService$2.callBlockingMethod(StorageContainerDatanodeProtocolProtos.java:27753)
>  at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:524)
>  at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:1025)
>  at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:876)
>  at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:822)
>  at java.security.AccessController.doPrivileged(Native Method)
>  at javax.security.auth.Subject.doAs(Subject.java:422)
>  at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1730)
>  at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2682)
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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