Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-5655

SCM terminates when allocatecontainer happens on closed pipeline

    XMLWordPrintableJSON

Details

    Description

      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.

        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);
        }
      

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

      Attachments

        Issue Links

          Activity

            People

              bharat Bharat Viswanadham
              bharat Bharat Viswanadham
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: