You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Xintong Song (Jira)" <ji...@apache.org> on 2021/02/18 02:22:00 UTC

[jira] [Updated] (FLINK-14869) Force an extended resource to be null if it's value is 0

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

Xintong Song updated FLINK-14869:
---------------------------------
        Parent: FLINK-14187
    Issue Type: Sub-task  (was: Improvement)

> Force an extended resource to be null if it's value is 0
> --------------------------------------------------------
>
>                 Key: FLINK-14869
>                 URL: https://issues.apache.org/jira/browse/FLINK-14869
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Runtime / Coordination
>    Affects Versions: 1.10.0
>            Reporter: Zhu Zhu
>            Assignee: Xintong Song
>            Priority: Major
>
> {{Resource}} accepts value 0 at the moment because 0 {{CPUResource}} is used in production to indicate no strict requirement for CPU cores. 
> However, keeping extended resources with value 0 is causing troubles. 
> e.g. There can be 2 ResourceSpecs, rs1 and rs2, with the same resources except that rs1 contains a GPUResource with value 0 while rs2 does not contains a specified GPUResource. In this case, rs1.equals(rs2)==false and rs1.isLessOrEqualThan(rs2)==false, which is not correct.
> Accepting both 0 and null extended resources is also making things more complex, since we need to consider it in all comparisons(equals/lessThanOrEqual/isMatch) and aggregations(merge/subtract).
> To be simple, I'd propose to change it like this: in ResourceSpec/ResourceProfile we only keep extended resource with positive values. To be specific, if in the constructors of ResourceSpec/ResourceProfile, a specified extended resource is found to be 0, it must be dropped so that 0 resource would always be null.
> cc [~chesnay]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)