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

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

commit 5e1f25c8a6e8e465ff5cea8a46e90066f5bdcd1e
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 88c0438..ad1561b 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -1389,7 +1389,6 @@ void HierarchicalAllocatorProcess::reviveOffers(
   CHECK(frameworks.contains(frameworkId));
 
   Framework& framework = frameworks.at(frameworkId);
-  framework.offerFilters.clear();
   framework.inverseOfferFilters.clear();
 
   const set<string>& roles = roles_.empty() ? framework.roles : roles_;
@@ -1398,9 +1397,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(frameworkSorters.contains(role));
+    framework.offerFilters.erase(role);
 
+    CHECK(frameworkSorters.contains(role));
     frameworkSorters.at(role)->activate(frameworkId.value());
+
     framework.suppressedRoles.erase(role);
     framework.metrics->reviveRole(role);
   }

Reply via email to