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

ASF GitHub Bot logged work on HDDS-1888:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/Aug/19 14:19
            Start Date: 07/Aug/19 14:19
    Worklog Time Spent: 10m 
      Work Description: nandakumar131 commented on pull request #1211: 
HDDS-1888. Add containers to node2container map in SCM as soon as a container 
is created.
URL: https://github.com/apache/hadoop/pull/1211#discussion_r311579697
 
 

 ##########
 File path: 
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/MockNodeManager.java
 ##########
 @@ -267,6 +267,19 @@ public void removePipeline(Pipeline pipeline) {
     node2PipelineMap.removePipeline(pipeline);
   }
 
+  @Override
+  public void addContainer(DatanodeDetails dd,
+                           ContainerID containerId)
+      throws NodeNotFoundException {
+    try {
+      Set<ContainerID> set = node2ContainerMap.getContainers(dd.getUuid());
+      set.add(containerId);
+      node2ContainerMap.setContainersForDatanode(dd.getUuid(), set);
+    } catch (SCMException e) {
+      e.printStackTrace();
 
 Review comment:
   We can only throw `NodeNotFoundException` or any runtime exception.
   > log the error.
   `printStackTrace` was added to log the error :) We don't have any logger 
defined in MockNodeManager.
   
   The test-case using `MockNodeManager` will anyways depend on the existence 
of container after calling addContainer, and the test should eventually fail if 
this call fails.
 
----------------------------------------------------------------
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


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

    Worklog Id:     (was: 290487)
    Time Spent: 1h 10m  (was: 1h)

> Add containers to node2container map in SCM as soon as a container is created
> -----------------------------------------------------------------------------
>
>                 Key: HDDS-1888
>                 URL: https://issues.apache.org/jira/browse/HDDS-1888
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>          Components: SCM
>            Reporter: Nanda kumar
>            Assignee: Nanda kumar
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> In SCM node2container and node2pipeline maps are managed by NodeManager and 
> pipeline2container map is managed by PipelineManager.
> Currently, when a container is allocated in SCM, it is added to 
> pipeline2container map and we are not adding it to node2container map. We 
> update the node2container map only when the datanode sends full container 
> report.
> When a node is marked as dead, DeadNodeHandler processes the event and it 
> gets the list of containers that are hosted by the dead datanode and updates 
> the respective container replica state in ContainerManager. The list of 
> containers on the datanode is read from node2container map, this map will be 
> missing containers which are created recently (after the last container 
> report). In such cases we not be able to remove the container replica 
> information for those containers. In reality, these containers are under 
> replicated, but SCM will never know.
> We should add containers to node2container map in SCM as soon as a container 
> is allocated.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

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