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

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

commit 2c27bccda87de1f63913a76ee9db18fb4e797cc6
Author: Andrei Sekretenko <[email protected]>
AuthorDate: Fri Jun 21 14:50:32 2019 -0400

    Fixed REVIVE to clear filters for only the specified roles.
    
    This is a fix for MESOS-9856 bug wich was causing all the offer filters
    to be cleared by reviveOffers() called for a specific subset of roles.
    
    Review: https://reviews.apache.org/r/70926/
---
 src/master/allocator/mesos/hierarchical.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/master/allocator/mesos/hierarchical.cpp 
b/src/master/allocator/mesos/hierarchical.cpp
index c9ed094..7076e96 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -1370,7 +1370,6 @@ void HierarchicalAllocatorProcess::reviveOffers(
   CHECK_CONTAINS(frameworks, frameworkId);
 
   Framework& framework = frameworks.at(frameworkId);
-  framework.offerFilters.clear();
   framework.inverseOfferFilters.clear();
 
   const set<string>& roles = roles_.empty() ? framework.roles : roles_;
@@ -1379,9 +1378,11 @@ void HierarchicalAllocatorProcess::reviveOffers(
   // SUPPRESS is not parameterized. When parameterization is added,
   // we may need to differentiate between the cases here.
   foreach (const string& role, roles) {
-    CHECK_CONTAINS(frameworkSorters, role);
+    framework.offerFilters.erase(role);
 
+    CHECK_CONTAINS(frameworkSorters, role);
     frameworkSorters.at(role)->activate(frameworkId.value());
+
     framework.suppressedRoles.erase(role);
     framework.metrics->reviveRole(role);
   }

Reply via email to