Bharat Viswanadham created HDDS-5655:
----------------------------------------

             Summary: SCM terminates when allocatecontainer happens on closed 
pipeline
                 Key: HDDS-5655
                 URL: https://issues.apache.org/jira/browse/HDDS-5655
             Project: Apache Ozone
          Issue Type: Bug
            Reporter: Bharat Viswanadham
            Assignee: Bharat Viswanadham


Scenario like this:
1. AllocateContainer selects open pipeline (This point it is open)
2. PipelineActionHandler comes and closes pipeline by calling 
pipelineManager#closePipeline which calls  
stateManager#updatePipelineState(pipelineID.getProtobuf(),
            HddsProtos.PipelineState.PIPELINE_CLOSED);
3. Now when containerStateManager#addContainer(containerInfo) is called, which 
calls  pipelineManager.addContainerToPipeline(pipelineID, containerID); this 
will fail, as now pipeline becomes closed  due to below piece of code. As 
containerStateManager#addContainer is replicateCall happens in StateMachine if 
any exception we terminate SCM.


{code:java}
  void addContainerToPipeline(PipelineID pipelineID, ContainerID containerID)
      throws IOException {
    Preconditions.checkNotNull(pipelineID,
        "Pipeline Id cannot be null");
    Preconditions.checkNotNull(containerID,
        "Container Id cannot be null");

    Pipeline pipeline = getPipeline(pipelineID);
    if (pipeline.isClosed()) {
      throw new IOException(String
          .format("Cannot add container to pipeline=%s in closed state",
              pipelineID));
    }
    pipeline2container.get(pipelineID).add(containerID);
  }
{code}

*Proposed Solution:*
Acquire pipelineManager during allocateContainer to avoid any updates to 
pipelineState.




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to