[
https://issues.apache.org/jira/browse/YARN-7461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16402037#comment-16402037
]
Sunil G commented on YARN-7461:
-------------------------------
When multiple resource types are considered, then its possible that one such
resource may have 0 in numerator or in denominator. I can see that we are
skipping such entries. But my concern is that such a scenario may not compute
accurate ratio and could impact higher level api uses like DRC#lessThanOrEquals
which internally calls a RC#compare and eventually comes to ratio. Ideally we
want to see whether resourceA is less than resourceB and in such case its
possible that resourceA may have 5 as resource value for resource type X and
resourceB may have 0 for same type X.
So my worry is that how it will affect in a computation where resources are
having values corresponding each resource types heterogeneously.
> DominantResourceCalculator#ratio calculation problem when right resource
> contains zero value
> --------------------------------------------------------------------------------------------
>
> Key: YARN-7461
> URL: https://issues.apache.org/jira/browse/YARN-7461
> Project: Hadoop YARN
> Issue Type: Bug
> Affects Versions: 3.0.0-alpha4
> Reporter: Tao Yang
> Assignee: Tao Yang
> Priority: Minor
> Attachments: YARN-7461.001.patch, YARN-7461.002.patch,
> YARN-7461.003.patch, YARN-7461.004.patch
>
>
> Currently DominantResourceCalculator#ratio may return wrong result when right
> resource contains zero value. For example, there are three resource types
> such as <memory-mb, vcores, vssd>, leftResource=<5, 5, 0> and
> rightResource=<10, 10, 0>, we expect the result of
> DominantResourceCalculator#ratio(leftResource, rightResource) is 0.5 but
> currently is NaN.
> There should be a verification before divide calculation to ensure that
> dividend is not zero.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]