You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mz...@apache.org on 2019/05/14 15:14:58 UTC

[mesos] branch 1.6.x updated (7eec91d -> 8f78816)

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

mzhu pushed a change to branch 1.6.x
in repository https://gitbox.apache.org/repos/asf/mesos.git.


    from 7eec91d  Added MESOS-9766 to the 1.6.3 CHANGELOG.
     new 4111b84  Logged headroom related info in the allocator.
     new 80ef788  Avoided logging quota headroom info when there is no quota set.
     new 424fd99  Relaxed `Promise` constructor and assignment operator requirements.
     new 8f78816  Enabled more constructors for master `RegistryOperation`.

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 3rdparty/libprocess/include/process/future.hpp | 16 ++++++---------
 src/master/allocator/mesos/hierarchical.cpp    | 28 ++++++++++++++++++++++++++
 src/master/registrar.hpp                       |  5 +----
 3 files changed, 35 insertions(+), 14 deletions(-)


[mesos] 02/04: Avoided logging quota headroom info when there is no quota set.

Posted by mz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 80ef788583bc9a5992b52db4688fee613a9c9dd6
Author: Meng Zhu <mz...@mesosphere.io>
AuthorDate: Mon May 13 15:58:43 2019 +0200

    Avoided logging quota headroom info when there is no quota set.
    
    Review: https://reviews.apache.org/r/70633
---
 src/master/allocator/mesos/hierarchical.cpp | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/master/allocator/mesos/hierarchical.cpp b/src/master/allocator/mesos/hierarchical.cpp
index 1c11a3f..302cacd 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -1734,9 +1734,11 @@ void HierarchicalAllocatorProcess::__allocate()
       slave.getAvailable().revocable().createStrippedScalarQuantity();
   }
 
-  LOG(INFO) << "Before allocation, required quota headroom is "
-            << requiredHeadroom
-            << " and available quota headroom is " << availableHeadroom;
+  if (!quotas.empty()) {
+    LOG(INFO) << "Before allocation, required quota headroom is "
+              << requiredHeadroom
+              << " and available quota headroom is " << availableHeadroom;
+  }
 
   // Due to the two stages in the allocation algorithm and the nature of
   // shared resources being re-offerable even if already allocated, the
@@ -2172,11 +2174,13 @@ void HierarchicalAllocatorProcess::__allocate()
     }
   }
 
-  LOG(INFO) << "After allocation, " << requiredHeadroom
-            << " are required for quota headroom, "
-            << heldBackForHeadroom << " were held back from "
-            << heldBackAgentCount
-            << " agents to ensure sufficient quota headroom";
+  if (!quotas.empty()) {
+    LOG(INFO) << "After allocation, " << requiredHeadroom
+              << " are required for quota headroom, "
+              << heldBackForHeadroom << " were held back from "
+              << heldBackAgentCount
+              << " agents to ensure sufficient quota headroom";
+  }
 
   if (offerable.empty()) {
     VLOG(2) << "No allocations performed";


[mesos] 03/04: Relaxed `Promise` constructor and assignment operator requirements.

Posted by mz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 424fd997b85d71bea202dddf81a813dfbdf651b9
Author: Benjamin Bannier <be...@mesosphere.io>
AuthorDate: Thu Oct 18 09:33:35 2018 +0200

    Relaxed `Promise` constructor and assignment operator requirements.
    
    This patch enables construction and assignment from rvalues for
    `Promise` values.
    
    Review: https://reviews.apache.org/r/69041/
---
 3rdparty/libprocess/include/process/future.hpp | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/3rdparty/libprocess/include/process/future.hpp b/3rdparty/libprocess/include/process/future.hpp
index fb107d2..369007b 100644
--- a/3rdparty/libprocess/include/process/future.hpp
+++ b/3rdparty/libprocess/include/process/future.hpp
@@ -704,7 +704,12 @@ public:
   explicit Promise(const T& t);
   virtual ~Promise();
 
-  Promise(Promise<T>&& that);
+  // Not copyable, not assignable.
+  Promise(const Promise& that) = delete;
+  Promise(Promise&& that) = default;
+  Promise& operator=(const Promise&) = delete;
+  Promise& operator=(Promise&&) = default;
+
 
   bool discard();
   bool set(const T& _t);
@@ -725,10 +730,6 @@ private:
   template <typename U>
   bool _set(U&& u);
 
-  // Not copyable, not assignable.
-  Promise(const Promise<T>&);
-  Promise<T>& operator=(const Promise<T>&);
-
   // Helper for doing the work of actually discarding a future (called
   // from Promise::discard as well as internal::discarded).
   static bool discard(Future<T> future);
@@ -802,11 +803,6 @@ Promise<T>::~Promise()
 
 
 template <typename T>
-Promise<T>::Promise(Promise<T>&& that)
-  : f(std::move(that.f)) {}
-
-
-template <typename T>
 bool Promise<T>::discard()
 {
   if (!f.data->associated) {


[mesos] 01/04: Logged headroom related info in the allocator.

Posted by mz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4111b84060b1576317fae362c811567d596b719c
Author: Meng Zhu <mz...@mesosphere.io>
AuthorDate: Mon Apr 29 17:49:15 2019 -0700

    Logged headroom related info in the allocator.
    
    This patch logs `requiredHeadroom` and `availableHeadroom`
    before each allocation cycle and logs `requiredHeadroom`,
    resources and number of agents held back for quota `headroom`
    as well as resources filtered at the end of each allocation
    cycle.
    
    While we also held resources back for quota headroom in the
    first stage, we do not log it there. This is because in the
    second stage, we try to allocate all resources (including the
    ones held back in the first stage). Thus only resources held
    back in the second stage are truly held back for the whole
    allocation cycle.
    
    Review: https://reviews.apache.org/r/70570
---
 src/master/allocator/mesos/hierarchical.cpp | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/src/master/allocator/mesos/hierarchical.cpp b/src/master/allocator/mesos/hierarchical.cpp
index c9d97dc..1c11a3f 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -1734,6 +1734,10 @@ void HierarchicalAllocatorProcess::__allocate()
       slave.getAvailable().revocable().createStrippedScalarQuantity();
   }
 
+  LOG(INFO) << "Before allocation, required quota headroom is "
+            << requiredHeadroom
+            << " and available quota headroom is " << availableHeadroom;
+
   // Due to the two stages in the allocation algorithm and the nature of
   // shared resources being re-offerable even if already allocated, the
   // same shared resources can appear in two (and not more due to the
@@ -2009,6 +2013,18 @@ void HierarchicalAllocatorProcess::__allocate()
   // are not part of the headroom (and therefore can't be used to satisfy
   // quota guarantees).
 
+  // For logging purposes, we track the number of agents that had resources
+  // held back for quota headroom, as well as how many resources in total
+  // were held back.
+  //
+  // While we also held resources back for quota headroom in the first stage,
+  // we do not track it there. This is because in the second stage, we try to
+  // allocate all resources (including the ones held back in the first stage).
+  // Thus only resources held back in the second stage are truly held back for
+  // the whole allocation cycle.
+  Resources heldBackForHeadroom;
+  size_t heldBackAgentCount = 0;
+
   foreach (const SlaveID& slaveId, slaveIds) {
     foreach (const string& role, roleSorter->sort()) {
       // In the second allocation stage, we only allocate
@@ -2118,6 +2134,8 @@ void HierarchicalAllocatorProcess::__allocate()
 
         if (!sufficientHeadroom) {
           toAllocate -= headroomToAllocate;
+          heldBackForHeadroom += headroomToAllocate;
+          ++heldBackAgentCount;
         }
 
         // If the resources are not allocatable, ignore. We cannot break
@@ -2154,6 +2172,12 @@ void HierarchicalAllocatorProcess::__allocate()
     }
   }
 
+  LOG(INFO) << "After allocation, " << requiredHeadroom
+            << " are required for quota headroom, "
+            << heldBackForHeadroom << " were held back from "
+            << heldBackAgentCount
+            << " agents to ensure sufficient quota headroom";
+
   if (offerable.empty()) {
     VLOG(2) << "No allocations performed";
   } else {


[mesos] 04/04: Enabled more constructors for master `RegistryOperation`.

Posted by mz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8f788167ea13258da28c9082df41507c849d7d52
Author: Benjamin Bannier <be...@mesosphere.io>
AuthorDate: Thu Oct 18 09:33:39 2018 +0200

    Enabled more constructors for master `RegistryOperation`.
    
    Since this class was explicitly declaring a constructor, no other
    constructors such as copy or move constructors were generated.
    
    This patch removes the custom constructor so all default constructors
    are generated automatically. This e.g., enables move construction of
    `RegistryOperation` values.
    
    Review: https://reviews.apache.org/r/69042/
---
 src/master/registrar.hpp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/master/registrar.hpp b/src/master/registrar.hpp
index 70a24fd..b5aa47f 100644
--- a/src/master/registrar.hpp
+++ b/src/master/registrar.hpp
@@ -45,9 +45,6 @@ class RegistrarProcess;
 class RegistryOperation : public process::Promise<bool>
 {
 public:
-  RegistryOperation() : success(false) {}
-  virtual ~RegistryOperation() {}
-
   // Attempts to invoke the operation on the registry object.
   // Aided by accumulator(s):
   //   slaveIDs - is the set of registered slaves.
@@ -70,7 +67,7 @@ protected:
   virtual Try<bool> perform(Registry* registry, hashset<SlaveID>* slaveIDs) = 0;
 
 private:
-  bool success;
+  bool success = false;
 };