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

Tao Yang commented on YARN-7461:
--------------------------------

Updated v4 patch to run RM test cases through fixing check-style errors in 
TestContainerAllocation.

Thanks [~cheersyang] and [~leftnoteasy] for your reviews and suggestions.

This patch won't change the common behavior of ratio(a,b), it can get >1 when 
a>b and get <1 when a<b. It only handle one bad case that values of the same 
resource type in a and b both are zero. For example: a=<2,2,0>, b=<1,1,0>, 
result=2.0 (result before this patch is NaN). Other cases are all following the 
old behavior.

YARN-8020/YARN-6538 seems irrelevant to this issue and even the ratio 
calculation. 

> 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]

Reply via email to