This is an automated email from the ASF dual-hosted git repository.

mzhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit be3b4f6001b4aa30cf05eef611b5348ff2a50d40
Author: Meng Zhu <[email protected]>
AuthorDate: Tue May 28 12:07:47 2019 +0200

    Refactored no guarantee resources allocation logic in the 1st stage.
    
    Review: https://reviews.apache.org/r/70731
---
 src/master/allocator/mesos/hierarchical.cpp | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/master/allocator/mesos/hierarchical.cpp 
b/src/master/allocator/mesos/hierarchical.cpp
index 36a9268..930eb8e 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -1898,18 +1898,15 @@ void HierarchicalAllocatorProcess::__allocate()
         // Second, allocate scalar resources with unset quota while maintaining
         // the quota headroom.
 
-        Resources nonQuotaGuaranteeResources =
+        Resources noGuaranteeScalarResources =
           unreserved.filter([&](const Resource& resource) {
-            return quotaGuarantees.get(resource.name()) == Value::Scalar();
+            return resource.type() == Value::SCALAR &&
+                   quotaGuarantees.get(resource.name()) == Value::Scalar();
           });
 
-        ResourceQuantities surplusHeadroom =
-          availableHeadroom - requiredHeadroom;
-
-        nonQuotaGuaranteeResources =
-          shrinkResources(nonQuotaGuaranteeResources, surplusHeadroom);
-
-        toAllocate += nonQuotaGuaranteeResources;
+        // surplusHeadroom = availableHeadroom - requiredHeadroom;
+        toAllocate += shrinkResources(
+            noGuaranteeScalarResources, availableHeadroom - requiredHeadroom);
 
         // Lastly, allocate non-scalar resources--we currently do not support
         // setting quota for non-scalar resources. They are always allocated

Reply via email to