You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2017/12/22 01:28:04 UTC
mesos git commit: Fixed a bug where quota headroom is tracked
incorrectly.
Repository: mesos
Updated Branches:
refs/heads/master e49e87950 -> 8714e97be
Fixed a bug where quota headroom is tracked incorrectly.
Only resources allocated towards a role's quota should be
subtracted from `requiredHeadroom`. In addition to this,
unreserved resources in the quota allocation stage may also
contain resources that a role does not have quota for, they
should not be subtracted from `requiredHeadroom`.
Review: https://reviews.apache.org/r/64792/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/8714e97b
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/8714e97b
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/8714e97b
Branch: refs/heads/master
Commit: 8714e97be537994c19b2d17c407af070eec13fab
Parents: e49e879
Author: Meng Zhu <mz...@mesosphere.io>
Authored: Thu Dec 21 17:27:30 2017 -0800
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Thu Dec 21 17:27:30 2017 -0800
----------------------------------------------------------------------
src/master/allocator/mesos/hierarchical.cpp | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/8714e97b/src/master/allocator/mesos/hierarchical.cpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/hierarchical.cpp b/src/master/allocator/mesos/hierarchical.cpp
index 7f7dae1..78d7b22 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -1976,13 +1976,15 @@ void HierarchicalAllocatorProcess::__allocate()
offerable[frameworkId][role][slaveId] += resources;
offeredSharedResources[slaveId] += resources.shared();
- unsatisfiedQuota -= newQuotaAllocation.createStrippedScalarQuantity();
+ Resources newQuotaAllocationScalarQuantities =
+ newQuotaAllocation.createStrippedScalarQuantity();
+
+ unsatisfiedQuota -= newQuotaAllocationScalarQuantities;
// Track quota headroom change.
- Resources headroomDelta =
+ requiredHeadroom -= newQuotaAllocationScalarQuantities;
+ availableHeadroom -=
resources.unreserved().createStrippedScalarQuantity();
- requiredHeadroom -= headroomDelta;
- availableHeadroom -= headroomDelta;
// Update the tracking of allocated reservations.
//