You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Jay Guo <gu...@gmail.com> on 2016/12/08 07:10:44 UTC

Review Request 54524: Updated `resources()` method to return resources used by role.

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

Review request for mesos, Benjamin Mahler and Guangya Liu.


Bugs: MESOS-6685
    https://issues.apache.org/jira/browse/MESOS-6685


Repository: mesos


Description
-------

Currently `resources()` method in `struct Role` of master.hpp returns
totalUsedResources and totalOfferedResources for a framework, which is
inaccurate for multi-role frameworks. A filter is added to filter out
actual resources for specific role in a framework.


Diffs
-----

  src/master/master.hpp d3c20d7cbb9137d3b05cae3d67f004d5e7475c8a 
  src/master/master.cpp 353e6ea802e197b4456c1647f78d9984a50f1c9d 

Diff: https://reviews.apache.org/r/54524/diff/


Testing
-------

This patch is just to showcase a possible solution for accounting resources used by a role in multi-role framework. It fails certain test cases since `allocation_info` is not filled yet.


Thanks,

Jay Guo


Re: Review Request 54524: Updated `resources()` method to return resources used by role.

Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54524/#review158568
-----------------------------------------------------------



Looks good, is it possible to write this patch such that it continues to work for single role frameworks? That way we could land this and have a DISABLED test for this on the multi-role side without breaking the single role framework case.


src/master/master.hpp (line 2703)
<https://reviews.apache.org/r/54524/#comment229352>

    Can you use = delete here?


- Benjamin Mahler


On Dec. 8, 2016, 7:10 a.m., Jay Guo wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54524/
> -----------------------------------------------------------
> 
> (Updated Dec. 8, 2016, 7:10 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Guangya Liu.
> 
> 
> Bugs: MESOS-6685
>     https://issues.apache.org/jira/browse/MESOS-6685
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Currently `resources()` method in `struct Role` of master.hpp returns
> totalUsedResources and totalOfferedResources for a framework, which is
> inaccurate for multi-role frameworks. A filter is added to filter out
> actual resources for specific role in a framework.
> 
> 
> Diffs
> -----
> 
>   src/master/master.hpp d3c20d7cbb9137d3b05cae3d67f004d5e7475c8a 
>   src/master/master.cpp 353e6ea802e197b4456c1647f78d9984a50f1c9d 
> 
> Diff: https://reviews.apache.org/r/54524/diff/
> 
> 
> Testing
> -------
> 
> This patch is just to showcase a possible solution for accounting resources used by a role in multi-role framework. It fails certain test cases since `allocation_info` is not filled yet.
> 
> 
> Thanks,
> 
> Jay Guo
> 
>


Re: Review Request 54524: Updated `resources()` method to return resources used by role.

Posted by Mesos ReviewBot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54524/#review158510
-----------------------------------------------------------



Bad review!

Reviews applied: [54524, 54361, 54522, 54521, 54365]

Error:
Circular dependency detected for review 54361.Please fix the 'depends_on' field.

- Mesos ReviewBot


On Dec. 8, 2016, 7:10 a.m., Jay Guo wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54524/
> -----------------------------------------------------------
> 
> (Updated Dec. 8, 2016, 7:10 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Guangya Liu.
> 
> 
> Bugs: MESOS-6685
>     https://issues.apache.org/jira/browse/MESOS-6685
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Currently `resources()` method in `struct Role` of master.hpp returns
> totalUsedResources and totalOfferedResources for a framework, which is
> inaccurate for multi-role frameworks. A filter is added to filter out
> actual resources for specific role in a framework.
> 
> 
> Diffs
> -----
> 
>   src/master/master.hpp d3c20d7cbb9137d3b05cae3d67f004d5e7475c8a 
>   src/master/master.cpp 353e6ea802e197b4456c1647f78d9984a50f1c9d 
> 
> Diff: https://reviews.apache.org/r/54524/diff/
> 
> 
> Testing
> -------
> 
> This patch is just to showcase a possible solution for accounting resources used by a role in multi-role framework. It fails certain test cases since `allocation_info` is not filled yet.
> 
> 
> Thanks,
> 
> Jay Guo
> 
>


Re: Review Request 54524: Updated `resources()` method to return resources used by role.

Posted by Mesos ReviewBot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54524/#review158653
-----------------------------------------------------------



Bad review!

Reviews applied: [54524, 54365, 54361]

Error:
Circular dependency detected for review 54365.Please fix the 'depends_on' field.

- Mesos ReviewBot


On Dec. 9, 2016, 5:41 a.m., Jay Guo wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54524/
> -----------------------------------------------------------
> 
> (Updated Dec. 9, 2016, 5:41 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Guangya Liu.
> 
> 
> Bugs: MESOS-6685
>     https://issues.apache.org/jira/browse/MESOS-6685
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Currently `resources()` method in `struct Role` of master.hpp returns
> totalUsedResources and totalOfferedResources for a framework, which is
> inaccurate for multi-role frameworks. A filter is added to capture the
> actual resources for specific role in multi-role frameworks.
> 
> 
> Diffs
> -----
> 
>   src/master/master.hpp d3c20d7cbb9137d3b05cae3d67f004d5e7475c8a 
>   src/master/master.cpp 353e6ea802e197b4456c1647f78d9984a50f1c9d 
> 
> Diff: https://reviews.apache.org/r/54524/diff/
> 
> 
> Testing
> -------
> 
> make check on Ubuntu 14.04
> 
> 
> Thanks,
> 
> Jay Guo
> 
>


Re: Review Request 54524: Updated `resources()` method to return resources used by role.

Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54524/#review158717
-----------------------------------------------------------


Ship it!




This could benefit from a clearer commit summary and description:

```
Updated `Role::resources()` in master to handle multi-role frameworks.

Currently, the `Role::resources()` method in the `master::Role` struct
returns the total resources used and offered to a framework, which will
be incorrect for multi-role frameworks.

For now, since the support for multi-role frameworks is incomplete
(in particular, the `Resource.allocation_info` is not yet populated),
we continue to handle single-role frameworks in the old manner. Once
the `Resource.allocation_info` is populated, we will remove the
single-role special case logic in `Role::resources()`.
```


src/master/master.hpp (lines 2686 - 2689)
<https://reviews.apache.org/r/54524/#comment229523>

    Comment sentences start with a capital letter. Maybe we should re-word this a bit to clarify:
    
    ```
          // TODO(jay_guo): MULTI_ROLE is handled as a special case because
          // the `Resource.allocation_info.role` is not yet populated. Once
          // the support is complete, we do not need the `else` logic here.
    ```



src/master/master.hpp (line 2692)
<https://reviews.apache.org/r/54524/#comment229520>

    Hm.. it seems this might be a bit clearer if we pass the role explicitly here rather than capturing it above:
    
    ```
    resources += framework->totalUsedResources.filter(allocatedTo(role));
    ```
    
    You would need:
    
    ```
    auto allocatedTo = [](const std::string& role) {
      return [role](const Resource& resource) {
        return resource.allocation_info().role() == role;
      };
    };
    ```


- Benjamin Mahler


On Dec. 9, 2016, 4:57 p.m., Jay Guo wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54524/
> -----------------------------------------------------------
> 
> (Updated Dec. 9, 2016, 4:57 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Guangya Liu.
> 
> 
> Bugs: MESOS-6685
>     https://issues.apache.org/jira/browse/MESOS-6685
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Currently `resources()` method in `struct Role` of master.hpp returns
> totalUsedResources and totalOfferedResources for a framework, which is
> inaccurate for multi-role frameworks. A filter is added to capture the
> actual resources for specific role in multi-role frameworks.
> 
> 
> Diffs
> -----
> 
>   src/master/master.hpp d3c20d7cbb9137d3b05cae3d67f004d5e7475c8a 
>   src/master/master.cpp 353e6ea802e197b4456c1647f78d9984a50f1c9d 
> 
> Diff: https://reviews.apache.org/r/54524/diff/
> 
> 
> Testing
> -------
> 
> make check on Ubuntu 14.04
> 
> 
> Thanks,
> 
> Jay Guo
> 
>


Re: Review Request 54524: Updated `resources()` method to return resources used by role.

Posted by Jay Guo <gu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54524/
-----------------------------------------------------------

(Updated Dec. 10, 2016, 12:57 a.m.)


Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Guangya Liu.


Changes
-------

addressed guangya's comments


Bugs: MESOS-6685
    https://issues.apache.org/jira/browse/MESOS-6685


Repository: mesos


Description
-------

Currently `resources()` method in `struct Role` of master.hpp returns
totalUsedResources and totalOfferedResources for a framework, which is
inaccurate for multi-role frameworks. A filter is added to capture the
actual resources for specific role in multi-role frameworks.


Diffs (updated)
-----

  src/master/master.hpp d3c20d7cbb9137d3b05cae3d67f004d5e7475c8a 
  src/master/master.cpp 353e6ea802e197b4456c1647f78d9984a50f1c9d 

Diff: https://reviews.apache.org/r/54524/diff/


Testing
-------

make check on Ubuntu 14.04


Thanks,

Jay Guo


Re: Review Request 54524: Updated `resources()` method to return resources used by role.

Posted by Mesos ReviewBot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54524/#review158666
-----------------------------------------------------------



Patch looks great!

Reviews applied: [54524]

Passed command: export OS='ubuntu:14.04' BUILDTOOL='autotools' COMPILER='gcc' CONFIGURATION='--verbose' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker_build.sh

- Mesos ReviewBot


On Dec. 9, 2016, 9:39 a.m., Jay Guo wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54524/
> -----------------------------------------------------------
> 
> (Updated Dec. 9, 2016, 9:39 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Guangya Liu.
> 
> 
> Bugs: MESOS-6685
>     https://issues.apache.org/jira/browse/MESOS-6685
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Currently `resources()` method in `struct Role` of master.hpp returns
> totalUsedResources and totalOfferedResources for a framework, which is
> inaccurate for multi-role frameworks. A filter is added to capture the
> actual resources for specific role in multi-role frameworks.
> 
> 
> Diffs
> -----
> 
>   src/master/master.hpp d3c20d7cbb9137d3b05cae3d67f004d5e7475c8a 
>   src/master/master.cpp 353e6ea802e197b4456c1647f78d9984a50f1c9d 
> 
> Diff: https://reviews.apache.org/r/54524/diff/
> 
> 
> Testing
> -------
> 
> make check on Ubuntu 14.04
> 
> 
> Thanks,
> 
> Jay Guo
> 
>


Re: Review Request 54524: Updated `resources()` method to return resources used by role.

Posted by Guangya Liu <gy...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54524/#review158669
-----------------------------------------------------------


Fix it, then Ship it!




Ship It!


src/master/master.hpp (line 2681)
<https://reviews.apache.org/r/54524/#comment229472>

    How about rename this as `roleMatched`?


- Guangya Liu


On \u5341\u4e8c\u6708 9, 2016, 9:39 a.m., Jay Guo wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54524/
> -----------------------------------------------------------
> 
> (Updated \u5341\u4e8c\u6708 9, 2016, 9:39 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Guangya Liu.
> 
> 
> Bugs: MESOS-6685
>     https://issues.apache.org/jira/browse/MESOS-6685
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Currently `resources()` method in `struct Role` of master.hpp returns
> totalUsedResources and totalOfferedResources for a framework, which is
> inaccurate for multi-role frameworks. A filter is added to capture the
> actual resources for specific role in multi-role frameworks.
> 
> 
> Diffs
> -----
> 
>   src/master/master.hpp d3c20d7cbb9137d3b05cae3d67f004d5e7475c8a 
>   src/master/master.cpp 353e6ea802e197b4456c1647f78d9984a50f1c9d 
> 
> Diff: https://reviews.apache.org/r/54524/diff/
> 
> 
> Testing
> -------
> 
> make check on Ubuntu 14.04
> 
> 
> Thanks,
> 
> Jay Guo
> 
>


Re: Review Request 54524: Updated `resources()` method to return resources used by role.

Posted by Jay Guo <gu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54524/
-----------------------------------------------------------

(Updated Dec. 9, 2016, 5:39 p.m.)


Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Guangya Liu.


Bugs: MESOS-6685
    https://issues.apache.org/jira/browse/MESOS-6685


Repository: mesos


Description
-------

Currently `resources()` method in `struct Role` of master.hpp returns
totalUsedResources and totalOfferedResources for a framework, which is
inaccurate for multi-role frameworks. A filter is added to capture the
actual resources for specific role in multi-role frameworks.


Diffs
-----

  src/master/master.hpp d3c20d7cbb9137d3b05cae3d67f004d5e7475c8a 
  src/master/master.cpp 353e6ea802e197b4456c1647f78d9984a50f1c9d 

Diff: https://reviews.apache.org/r/54524/diff/


Testing
-------

make check on Ubuntu 14.04


Thanks,

Jay Guo


Re: Review Request 54524: Updated `resources()` method to return resources used by role.

Posted by Jay Guo <gu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54524/
-----------------------------------------------------------

(Updated Dec. 9, 2016, 1:41 p.m.)


Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Guangya Liu.


Bugs: MESOS-6685
    https://issues.apache.org/jira/browse/MESOS-6685


Repository: mesos


Description
-------

Currently `resources()` method in `struct Role` of master.hpp returns
totalUsedResources and totalOfferedResources for a framework, which is
inaccurate for multi-role frameworks. A filter is added to capture the
actual resources for specific role in multi-role frameworks.


Diffs
-----

  src/master/master.hpp d3c20d7cbb9137d3b05cae3d67f004d5e7475c8a 
  src/master/master.cpp 353e6ea802e197b4456c1647f78d9984a50f1c9d 

Diff: https://reviews.apache.org/r/54524/diff/


Testing (updated)
-------

make check on Ubuntu 14.04


Thanks,

Jay Guo


Re: Review Request 54524: Updated `resources()` method to return resources used by role.

Posted by Jay Guo <gu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54524/
-----------------------------------------------------------

(Updated Dec. 9, 2016, 1:41 p.m.)


Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Guangya Liu.


Changes
-------

addressed ben's comments.


Bugs: MESOS-6685
    https://issues.apache.org/jira/browse/MESOS-6685


Repository: mesos


Description (updated)
-------

Currently `resources()` method in `struct Role` of master.hpp returns
totalUsedResources and totalOfferedResources for a framework, which is
inaccurate for multi-role frameworks. A filter is added to capture the
actual resources for specific role in multi-role frameworks.


Diffs (updated)
-----

  src/master/master.hpp d3c20d7cbb9137d3b05cae3d67f004d5e7475c8a 
  src/master/master.cpp 353e6ea802e197b4456c1647f78d9984a50f1c9d 

Diff: https://reviews.apache.org/r/54524/diff/


Testing
-------

This patch is just to showcase a possible solution for accounting resources used by a role in multi-role framework. It fails certain test cases since `allocation_info` is not filled yet.


Thanks,

Jay Guo