Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.6.2, 1.7.2
Description
Due to a bug in the resources chopping logic:
https://github.com/apache/mesos/blob/1915150c6a83cd95197e25a68a6adf9b3ef5fb11/src/master/allocator/mesos/hierarchical.cpp#L1665-L1668
if (Resources::shrink(&resource, limitScalar.get())) { targetScalarQuantites[resource.name()] -= limitScalar.get(); // bug result += std::move(resource); }
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.
Since today, only disk resources might have the same name but different meta-data (for unreserved/nonrevocable/nonshared resources – we only chop this), this bug should only affect disk resources today.
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); }