This is an automated email from the ASF dual-hosted git repository. mzhu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mesos.git
commit a567684b80ca203276cfa3ce6d21e1de3a98b2c2 Author: Meng Zhu <[email protected]> AuthorDate: Mon Jun 3 17:53:32 2019 -0700 Added comments on allocating non-scalar resources in the allocator. See diff. Review: https://reviews.apache.org/r/70780 --- src/master/allocator/mesos/hierarchical.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/master/allocator/mesos/hierarchical.cpp b/src/master/allocator/mesos/hierarchical.cpp index aa4c438..d587696 100644 --- a/src/master/allocator/mesos/hierarchical.cpp +++ b/src/master/allocator/mesos/hierarchical.cpp @@ -1857,10 +1857,19 @@ void HierarchicalAllocatorProcess::__allocate() // the disk, gpu, and ports in the allocation, despite the // role not having any quota guarantee for them. // - // We have to do this for now because it's not possible to set - // quota on non-scalar resources, like ports. For scalar resources - // that this role has no quota for, it can be allocated as long - // as the quota headroom is not violated. + // Rationale of allocating all non-guaranteed resources on the agent + // (subject to role limits and global headroom requirements): + // + // Currently, it is not possible to set quota on non-scalar resources, + // like ports. A user may also only choose to set guarantees on some + // scalar resources (e.g. on cpu but not on memory). If we do not + // allocate these resources together with the guarantees, frameworks + // will get non-usable offers (e.g. with no ports or memory). + // However, the downside of this approach is that, after one allocation, + // the agent will be deprived of some resources (e.g. no ports), + // rendering any subsequent offers non-usable. Users are advised to + // leverage the `min_allocatbale_resources` to help prevent such offers + // and reduce resource fragmentation. // // TODO(mzhu): Since we're treating the resources with unset // quota as having no guarantee and no limit, these should be
