Meng Zhu created MESOS-9692:
-------------------------------

             Summary: Quota may be under allocated in the presence of different 
types of resources with the same name.
                 Key: MESOS-9692
                 URL: https://issues.apache.org/jira/browse/MESOS-9692
             Project: Mesos
          Issue Type: Bug
          Components: allocation
    Affects Versions: 1.7.2, 1.6.2, 1.5.3
            Reporter: Meng Zhu
            Assignee: Meng Zhu


Due to a bug in the resources chopping logic:
https://github.com/apache/mesos/blob/1915150c6a83cd95197e25a68a6adf9b3ef5fb11/src/master/allocator/mesos/hierarchical.cpp#L1665-L1668

{noformat}
      if (Resources::shrink(&resource, limitScalar.get())) {
        targetScalarQuantites[resource.name()] -= limitScalar.get(); // bug
        result += std::move(resource);
      }
{noformat}

When chopping different resources with the same name (e.g. vanilla disk and 
mount disk), we only include one of the resources. For example, if a role has a 
quota of 100disk, and an agent has 50 vanilla disk and 50 mount disk, the offer 
will only contain 50 disk (either vanilla or the mount type). The correct 
behavior should be that both disks should be offered.

The correct code should be:

      if (Resources::shrink(&resource, limitScalar.get())) {
        targetScalarQuantites[resource.name()] -= resource.scalar(); // Only 
subtract the shrunk resource scalar
        result += std::move(resource);
      }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to