You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2024/02/15 13:31:00 UTC

[jira] [Updated] (HDDS-10345) Sorting isn't needed when excluding Datanodes during Ratis Pipeline Creation

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

ASF GitHub Bot updated HDDS-10345:
----------------------------------
    Labels: pull-request-available  (was: )

> Sorting isn't needed when excluding Datanodes during Ratis Pipeline Creation
> ----------------------------------------------------------------------------
>
>                 Key: HDDS-10345
>                 URL: https://issues.apache.org/jira/browse/HDDS-10345
>             Project: Apache Ozone
>          Issue Type: Improvement
>          Components: SCM
>            Reporter: Siddhant Sangwan
>            Assignee: Siddhant Sangwan
>            Priority: Major
>              Labels: pull-request-available
>
> RatisPipelineProvider is used to create a new Ratis pipeline when SCM is asked to provide one and existing pipelines can't be used. Both WritableRatisContainerProvider and BackgroundPipelineCreator create pipelines this way, dynamically and in the background, respectively.
> As part of new pipeline creation, datanodes are excluded if they're already engaged in "ozone.scm.datanode.pipeline.limit" number of pipelines:
> {code}
>   private List<DatanodeDetails> filterPipelineEngagement() {
>     List<DatanodeDetails> healthyNodes =
>         getNodeManager().getNodes(NodeStatus.inServiceHealthy());
>     List<DatanodeDetails> excluded = healthyNodes.stream()
>         .map(d ->
>             new DnWithPipelines(d,
>                 PipelinePlacementPolicy
>                     .currentRatisThreePipelineCount(getNodeManager(),
>                     getPipelineStateManager(), d)))
>         .filter(d ->
>             (d.getPipelines() >= getNodeManager().pipelineLimit(d.getDn())))
>         .sorted(Comparator.comparingInt(DnWithPipelines::getPipelines))
>         .map(d -> d.getDn())
>         .collect(Collectors.toList());
>     return excluded;
>   }
> {code}
> I think sorting the Datanodes in this method is unnecessary as they only need to be excluded. This jira is meant to investigate and improve this code.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org