Tsz-wo Sze created HDDS-14371:
---------------------------------
Summary: ContainerManagerImpl.getOpenContainerCountPerPipeline
could have division by zero
Key: HDDS-14371
URL: https://issues.apache.org/jira/browse/HDDS-14371
Project: Apache Ozone
Issue Type: Bug
Components: SCM
Reporter: Tsz-wo Sze
{code}
private int getOpenContainerCountPerPipeline(Pipeline pipeline) {
int minContainerCountPerDn = numContainerPerVolume *
pipelineManager.minHealthyVolumeNum(pipeline);
int minPipelineCountPerDn = pipelineManager.minPipelineLimit(pipeline);
return (int) Math.ceil(
((double) minContainerCountPerDn / minPipelineCountPerDn));
}
{code}
- Division-by-zero bug: The value of minPipelineCountPerDn above could be zero
since SCMNodeManager.minPipelineLimit(..) could return zero.
- Another minor performance problem: SCMNodeManager.minPipelineLimit(..) should
not create a list for computing min.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]