[ 
https://issues.apache.org/jira/browse/HDDS-6379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17498800#comment-17498800
 ] 

István Fajth commented on HDDS-6379:
------------------------------------

Hi [~sadanand_shenoy],

We discussed about your comment briefly with Zita, and I wanted to note a few 
things.
Currently the standalone pipelines are used in the EC write path on the EC 
development branch, so we can not remove them fully for sure, and some of the 
client APIs (the EC part) will still use it in the future as it stands now.

I agree that the CLI should not create standalone pipeline on its own, but we 
can not remove it fully from the client API I think. I have created HDDS-6218 
for removing the standalone client from non-EC writes, but after you pointed 
out HDDS-1056, we will need to harmonize the two efftort, and probably that 
will be handled as part of EC developments.

In this particular case I think the solution is to fix this method, the sole 
role of this currentPipelineCount method is to count the number of already 
existing non-closed RATIS/THREE pipeline count on a particular node. And it 
fails to do so, so this - I strongly believe - is a bug we need to fix. Thanks 
to the fact that there are still tests creating standalone pipelines we have 
discovered this, so we might also look into the pipeline management code, and 
see if and how we should test for cases where a standalone pipeline is also 
open for a DataNode, or whether we can use that as a transient object instead 
of something being accounted for in the SCM's node manager on the long run, but 
these are all out of scope for this problem.

> Not deducting the STANDALONE pipelines when counting pipelines on each 
> datanode to check the pipeline limit.
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: HDDS-6379
>                 URL: https://issues.apache.org/jira/browse/HDDS-6379
>             Project: Apache Ozone
>          Issue Type: Bug
>          Components: Ozone Datanode, SCM
>    Affects Versions: 1.2.0
>            Reporter: Zita Dombi
>            Assignee: Zita Dombi
>            Priority: Major
>
> So I found this bug when I tried to add robot tests to the ozone debug CLI, 
> but I was able to recreate it locally. I had three datanodes and created a 
> new pipeline with the ozone admin pipeline create command, which chose a 
> datanode and made a STANDALONE/ONE pipeline with it. After that I stopped a 
> datanode and waited until it had a DEAD state; after I started it again it 
> didn't create a RATIS/THREE pipeline, even though there were three healthy 
> datanodes and no RATIS/THREE pipeline.
> In the docker-config the ozone.scm.datanode.pipeline.limit property is set to 
> 1 (the default is 2) due to the multi raft support. When we are trying to 
> create the pipeline we are making a healthy datanode list where we are 
> filtering the list based on the pipeline limit. We are calculating the 
> currect pipeline count like this on a datanode:
> {code:java}
> int currentPipelineCount(DatanodeDetails datanodeDetails, int nodesRequired) {
>     // Datanodes from pipeline in some states can also be considered available
>     // for pipeline allocation. Thus the number of these pipeline shall be
>     // deducted from total heaviness calculation.
>     int pipelineNumDeductable = 0;
>     Set<PipelineID> pipelines = nodeManager.getPipelines(datanodeDetails);
>     for (PipelineID pid : pipelines) {
>       Pipeline pipeline;
>       try {
>         pipeline = stateManager.getPipeline(pid);
>       } catch (PipelineNotFoundException e) {
>         LOG.debug("Pipeline not found in pipeline state manager during" +
>             " pipeline creation. PipelineID: {}", pid, e);
>         continue;
>       }
>       if (pipeline != null &&
>           // single node pipeline are not accounted for while determining
>           // the pipeline limit for dn
>           pipeline.getType() == HddsProtos.ReplicationType.RATIS &&
>           (RatisReplicationConfig
>               .hasFactor(pipeline.getReplicationConfig(), 
> ReplicationFactor.ONE)
>               ||
>               pipeline.getReplicationConfig().getRequiredNodes()
>                   == nodesRequired &&
>                   pipeline.getPipelineState()
>                       == Pipeline.PipelineState.CLOSED)) {
>         pipelineNumDeductable++;
>       }
>     }
>     return pipelines.size() - pipelineNumDeductable;
>   }
> {code}
> We are only deducting the RATIS replication type pipelines (due to this 
> condition: pipeline.getType() == HddsProtos.ReplicationType.RATIS), so will 
> count in the STANDALONE/ONE pipeline and because of that we will reach the 
> pipeline limit on that datanode, therefore we won't create a RATIS/THREE 
> pipeline.
> We should deduct all the single node pipelines in this check.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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

Reply via email to