This is an automated email from the ASF dual-hosted git repository. bmahler pushed a commit to branch 1.6.x in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 39f0cdaafef32e71d56fe71908425a666889c8a7 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 ad4326e..278ab9d 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); } }
