You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Bharat Viswanadham (Jira)" <ji...@apache.org> on 2021/08/25 15:41:00 UTC

[jira] [Resolved] (HDDS-5655) SCM terminates when allocatecontainer happens on closed pipeline

     [ https://issues.apache.org/jira/browse/HDDS-5655?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bharat Viswanadham resolved HDDS-5655.
--------------------------------------
    Fix Version/s: 1.2.0
       Resolution: Fixed

> 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
>          Components: SCM HA
>            Reporter: Bharat Viswanadham
>            Assignee: Bharat Viswanadham
>            Priority: Blocker
>              Labels: pull-request-available
>             Fix For: 1.2.0
>
>
> 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: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org