mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Park <mp...@apache.org>
Subject Re: Review Request 57167: Updated quota handler logic for hierarchical roles.
Date Tue, 28 Mar 2017 23:06:45 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57167/#review170328
-----------------------------------------------------------


Fix it, then Ship it!





src/master/quota_handler.cpp
Lines 111-115 (patched)
<https://reviews.apache.org/r/57167/#comment243132>

    Is this `CHECK` here to require that we only `insert` once per `role`...? If yes, it seems
that the comment is a bit confusing to me? Could you clarify the intended semantics here?



src/master/quota_handler.cpp
Lines 153-155 (patched)
<https://reviews.apache.org/r/57167/#comment243133>

    Let's still put the members at the bottom.



src/master/quota_handler.cpp
Lines 469-487 (original), 605-618 (patched)
<https://reviews.apache.org/r/57167/#comment243127>

    Couldn't this be just:
    
    ```cpp
    vector<string> components = strings::split(request.url.path, "/", 3u);
    if (components.size() < 3u) {
      return BadRequest(
          "Failed to parse request path '" + request.url.path +
          "': 3 tokens ('master', 'quota', 'role') required, found " +
          stringify(tokens.size()) + " token(s)"));
    }
    
    CHECK_EQ(3u, components.size());
    const string& role = components.back();
    /* ... */
    ```



src/tests/master_quota_tests.cpp
Lines 1800-1816 (patched)
<https://reviews.apache.org/r/57167/#comment243155>

    How about something like this?
    ```cpp
        map<string, Resources> expected = {{parent.role(), parent.guarantee()},
                                           {child.role(), child.guarantee()}};
    
        map<string, Resources> actual = {
          {status->infos(0).role(), status->infos(0).guarantee()},
          {status->infos(1).role(), status->infos(1).guarantee()}
        };
    
        EXPECT_EQ(expected, actual);
    ```


- Michael Park


On March 22, 2017, 5:53 p.m., Neil Conway wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/57167/
> -----------------------------------------------------------
> 
> (Updated March 22, 2017, 5:53 p.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The quota'd resources for a nested role are "included" within the
> quota'd resources for that role's parent. Hence, the quota of a node
> must always be greater than or equal to the sum of the quota'd resources
> of that role's children.
> 
> When creating and removing quota, we must ensure that this invariant is
> not violated.
> 
> When computing the cluster capacity heuristic, we must ensure that we do
> not "double-count" quota'd resources: e.g., if the cluster has a total
> capacity of 100 CPUs, role "x" has a quota guarantee of 80 CPUs, and
> role "x/y" has a quota guarantee of 40 CPUs, this does NOT violate the
> cluster capacity heuristic.
> 
> 
> Diffs
> -----
> 
>   src/master/quota_handler.cpp 36ea1acca47014b2fb7a3b597b857c8ec9e2ab67 
>   src/tests/hierarchical_allocator_tests.cpp e343dc37bd7136f0f6dd5dbc22a25cabe715038d

>   src/tests/master_quota_tests.cpp e418f22ea1773f4356ced44b8d57a80e826c8837 
> 
> 
> Diff: https://reviews.apache.org/r/57167/diff/8/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Neil Conway
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message