hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Work logged] (HDDS-1517) AllocateBlock call fails with ContainerNotFoundException
Date Mon, 20 May 2019 09:28:00 GMT

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

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

                Author: ASF GitHub Bot
            Created on: 20/May/19 09:27
            Start Date: 20/May/19 09:27
    Worklog Time Spent: 10m 
      Work Description: bshashikant commented on pull request #826: HDDS-1517. AllocateBlock
call fails with ContainerNotFoundException.
URL: https://github.com/apache/hadoop/pull/826#discussion_r285500751
 
 

 ##########
 File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/SCMContainerManager.java
 ##########
 @@ -386,18 +386,17 @@ public ContainerInfo getMatchingContainer(final long sizeRequired,
 
   public ContainerInfo getMatchingContainer(final long sizeRequired,
       String owner, Pipeline pipeline, List<ContainerID> excludedContainers) {
+    NavigableSet<ContainerID> containerIDs;
     try {
-      //TODO: #CLUTIL See if lock is required here
-      NavigableSet<ContainerID> containerIDs =
-          pipelineManager.getContainersInPipeline(pipeline.getId());
+      synchronized (pipeline) {
+        //TODO: #CLUTIL See if lock is required here
+        containerIDs =
+            pipelineManager.getContainersInPipeline(pipeline.getId());
 
-      containerIDs = getContainersForOwner(containerIDs, owner);
-      if (containerIDs.size() < numContainerPerOwnerInPipeline) {
-        synchronized (pipeline) {
+        containerIDs = getContainersForOwner(containerIDs, owner);
+        if (containerIDs.size() < numContainerPerOwnerInPipeline) {
           // TODO: #CLUTIL Maybe we can add selection logic inside synchronized
           // as well
-          containerIDs = getContainersForOwner(
-              pipelineManager.getContainersInPipeline(pipeline.getId()), owner);
           if (containerIDs.size() < numContainerPerOwnerInPipeline) {
             ContainerInfo containerInfo =
                 containerStateManager.allocateContainer(pipelineManager, owner,
 
 Review comment:
   The SCM cli option will exercise this code path, which has an option to create the container.
I think we can disable createContainer call from SCMCLI as it does not get used. What do you
think?
 
----------------------------------------------------------------
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:
users@infra.apache.org


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

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

> AllocateBlock call fails with ContainerNotFoundException
> --------------------------------------------------------
>
>                 Key: HDDS-1517
>                 URL: https://issues.apache.org/jira/browse/HDDS-1517
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>          Components: SCM
>    Affects Versions: 0.5.0
>            Reporter: Shashikant Banerjee
>            Assignee: Shashikant Banerjee
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.4.1
>
>         Attachments: HDDS-1517.000.patch
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> In allocateContainer call,  the container is first added to pipelineStateMap and then
added to container cache. If two allocate blocks execute concurrently, it might happen that
one find the container to exist in the pipelineStateMap but the container is yet to be updated
in the container cache, hence failing with CONTAINER_NOT_FOUND exception.



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


Mime
View raw message