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

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

commit afe3358c43fa930ee657e312d3796140ea1275d3
Author: Greg Mann <[email protected]>
AuthorDate: Wed Jan 16 11:34:07 2019 -0800

    Avoided reviving on behalf of scheduler after agent reconfiguration.
    
    When agent reconfiguration was enabled in Mesos, the allocator was
    also updated to remove all offer filters associated with an agent when
    that agent's attributes change. In addition, whenever filters for an
    agent are removed, the framework is revived for all roles that it is
    registered in.
    
    While this ensures that schedulers will have an opportunity to use
    resources on an agent after reconfiguration, modifying the scheduler's
    suppression may put the scheduler in an inconsistent state, where it
    believes it is suppressed in a particular role when it is not.
    
    This patch eliminates the suppression modification code, while
    keeping the code which removes a reconfigured agent's offer filters.
    
    Review: https://reviews.apache.org/r/68134/
---
 src/master/allocator/mesos/hierarchical.cpp | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/master/allocator/mesos/hierarchical.cpp 
b/src/master/allocator/mesos/hierarchical.cpp
index 95b447f..ebc7e51 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -725,22 +725,14 @@ void HierarchicalAllocatorProcess::removeFilters(const 
SlaveID& slaveId)
 {
   CHECK(initialized);
 
-  foreachpair (const FrameworkID& id,
-               Framework& framework,
-               frameworks) {
+  foreachvalue (Framework& framework, frameworks) {
     framework.inverseOfferFilters.erase(slaveId);
 
     // Need a typedef here, otherwise the preprocessor gets confused
     // by the comma in the template argument list.
     typedef hashmap<SlaveID, hashset<OfferFilter*>> Filters;
-    foreachpair(const string& role,
-                Filters& filters,
-                framework.offerFilters) {
-      size_t erased = filters.erase(slaveId);
-      if (erased) {
-        frameworkSorters.at(role)->activate(id.value());
-        framework.suppressedRoles.erase(role);
-      }
+    foreachvalue (Filters& filters, framework.offerFilters) {
+      filters.erase(slaveId);
     }
   }
 

Reply via email to