[
https://issues.apache.org/jira/browse/HDDS-10345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Attila Doroszlai resolved HDDS-10345.
-------------------------------------
Fix Version/s: 1.5.0
Resolution: Implemented
> 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
> Fix For: 1.5.0
>
>
> 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: [email protected]
For additional commands, e-mail: [email protected]