You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/01/16 23:47:32 UTC

[1/2] mesos git commit: Removed references to wDRF from allocator.

Repository: mesos
Updated Branches:
  refs/heads/master 31b94a58f -> 36c1b00ea


Removed references to wDRF from allocator.

Since wDRF is encapsulated in the choice of sorter, it should not be
mentioned in the allocator code.

Review: https://reviews.apache.org/r/42221/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d9135635
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d9135635
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d9135635

Branch: refs/heads/master
Commit: d913563567980e349ddc075fd60f3dfca46edbb6
Parents: 31b94a5
Author: Alexander Rukletsov <ru...@gmail.com>
Authored: Sat Jan 16 17:30:28 2016 -0500
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Sat Jan 16 17:36:45 2016 -0500

----------------------------------------------------------------------
 src/master/allocator/mesos/hierarchical.cpp | 40 +++++++++++++-----------
 1 file changed, 21 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/d9135635/src/master/allocator/mesos/hierarchical.cpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/hierarchical.cpp b/src/master/allocator/mesos/hierarchical.cpp
index 72e69a0..6207a0e 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -1180,7 +1180,8 @@ void HierarchicalAllocatorProcess::allocate(
         Resources resources = available.unreserved().nonRevocable();
 
         // NOTE: The resources may not be allocatable here, but they can be
-        // accepted by some framework during the DRF allocation stage.
+        // accepted by one of the frameworks during the second allocation
+        // stage.
         if (!allocatable(resources)) {
           continue;
         }
@@ -1214,7 +1215,7 @@ void HierarchicalAllocatorProcess::allocate(
 
   // Calculate how many resources (including revocable and reserved) are
   // available for allocation in the next round. We need this in order to
-  // ensure we do not over-allocate resources during the WDRF phase.
+  // ensure we do not over-allocate resources during the second stage.
   Resources remainingClusterResources;
   foreach (const SlaveID& slaveId, slaveIds) {
     remainingClusterResources +=
@@ -1232,26 +1233,26 @@ void HierarchicalAllocatorProcess::allocate(
     unallocatedQuotaResources += (required - allocated);
   }
 
-  // Determine how many resources we may allocate during the WDRF stage.
+  // Determine how many resources we may allocate during the next stage.
   // NOTE: Resources for quota allocations are already accounted in
   // `remainingClusterResources`.
   remainingClusterResources -= unallocatedQuotaResources;
 
-  // To ensure we do not over-allocate resources during the WDRF stage, we
-  // use 2 stopping criteria:
-  //   * No available resources for WDRF left, i.e.
-  //     `remainingClusterResources` - `allocatedForWDRF` is empty.
-  //   * A potential offer will force the WDRF stage to use more resources
+  // To ensure we do not over-allocate resources during the second stage
+  // with all frameworks, we use 2 stopping criteria:
+  //   * No available resources for the second stage left, i.e.
+  //     `remainingClusterResources` - `allocatedStage2` is empty.
+  //   * A potential offer will force the second stage to use more resources
   //     than available, i.e. `remainingClusterResources` does not contain
-  //     (`allocatedForWDRF` + potential offer). In this case we skip this
+  //     (`allocatedStage2` + potential offer). In this case we skip this
   //     agent and continue to the next one.
-  Resources allocatedForWDRF;
+  Resources allocatedStage2;
 
   // At this point resources for quotas are allocated or accounted for.
-  // Proceed with allocating the remaining free pool using WDRF.
+  // Proceed with allocating the remaining free pool.
   foreach (const SlaveID& slaveId, slaveIds) {
-    // If there are no resources available for the current WDRF stage, stop.
-    if ((remainingClusterResources - allocatedForWDRF).empty()) {
+    // If there are no resources available for the second stage, stop.
+    if ((remainingClusterResources - allocatedStage2).empty()) {
       break;
     }
 
@@ -1289,11 +1290,12 @@ void HierarchicalAllocatorProcess::allocate(
           continue;
         }
 
-        // If the offer generated by `resources` would force this WDRF stage
-        // to use more than `remainingClusterResources`, move along. We do
-        // not terminate early, as offers generated further in the loop may
-        // be small enough to fit within `remainingClusterResources`.
-        if (!remainingClusterResources.contains(allocatedForWDRF + resources)) {
+        // If the offer generated by `resources` would force the second
+        // stage to use more than `remainingClusterResources`, move along.
+        // We do not terminate early, as offers generated further in the
+        // loop may be small enough to fit within `remainingClusterResources`.
+        if (!remainingClusterResources.contains(
+                 allocatedStage2 + resources)) {
           continue;
         }
 
@@ -1305,7 +1307,7 @@ void HierarchicalAllocatorProcess::allocate(
         // NOTE: We may have already allocated some resources on the current
         // agent as part of quota.
         offerable[frameworkId][slaveId] += resources;
-        allocatedForWDRF += resources;
+        allocatedStage2 += resources;
         slaves[slaveId].allocated += resources;
 
         // Reserved resources are only accounted for in the framework


[2/2] mesos git commit: Quota: Checked whether the remaining cluster resources is allocatable.

Posted by jo...@apache.org.
Quota: Checked whether the remaining cluster resources is allocatable.

Review: https://reviews.apache.org/r/42254/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/36c1b00e
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/36c1b00e
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/36c1b00e

Branch: refs/heads/master
Commit: 36c1b00ea5ad9b072f9cc78dde10eb424bd50295
Parents: d913563
Author: Klaus Ma <kl...@gmail.com>
Authored: Sat Jan 16 17:41:09 2016 -0500
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Sat Jan 16 17:41:09 2016 -0500

----------------------------------------------------------------------
 src/master/allocator/mesos/hierarchical.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/36c1b00e/src/master/allocator/mesos/hierarchical.cpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/hierarchical.cpp b/src/master/allocator/mesos/hierarchical.cpp
index 6207a0e..b71e2c8 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -1252,7 +1252,7 @@ void HierarchicalAllocatorProcess::allocate(
   // Proceed with allocating the remaining free pool.
   foreach (const SlaveID& slaveId, slaveIds) {
     // If there are no resources available for the second stage, stop.
-    if ((remainingClusterResources - allocatedStage2).empty()) {
+    if (!allocatable(remainingClusterResources - allocatedStage2)) {
       break;
     }