Meng Zhu created MESOS-9691: ------------------------------- Summary: Quota headroom calculation is off when subroles are involved. Key: MESOS-9691 URL: https://issues.apache.org/jira/browse/MESOS-9691 Project: Mesos Issue Type: Bug Components: allocation Reporter: Meng Zhu
Quota "availableHeadroom" calculation: https://github.com/apache/mesos/blob/6276f7e73b0dbe7df49a7315cd1b83340d66f4ea/src/master/allocator/mesos/hierarchical.cpp#L1751-L1754 is off when subroles are involved. Specifically, in the formula {noformat} available headroom = total resources - allocated resources - (total reservations - allocated reservations) - unallocated revocable resources {noformat} The "allocated resources" part is hierarchical-aware and aggregate that across all roles, thus allocations to subroles will be counted multiple times (in the case of "a/b", once for "a" and once for "a/b"). The "total reservations" is correct, since today it is "flat" (reservations made to "a/b" are not counted to "a"). Thus all reservations are only counted once -- which is the correct semantic here. However, once we fix MESOS-9688 (which likely requires reservation tracking to be hierarchical-aware), we need to ensure that the accounting is still correct. The "allocated reservations" is hierarchical-aware, thus overlap accounting would occur. Basically, when calculating the available headroom, we need to ensure "single-counting". Ideally, we only need to look at the root's consumptions. -- This message was sent by Atlassian JIRA (v7.6.3#76005)