You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Benjamin Mahler <bm...@apache.org> on 2017/01/26 01:08:37 UTC

Review Request 55970: Updated the master's HTTP operations to handle MULTI_ROLE changes.

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

Review request for mesos, Benjamin Bannier, Jay Guo, Guangya Liu, and Michael Park.


Repository: mesos


Description
-------

With the addition of MULTI_ROLE framework support, allocated
resources in the master have `Resource.AllocationInfo` set. This
means that the master's http endpoints that apply operations or
perform checks between unallocated and allocated resources must
be updated to continue to function correctly.


Diffs
-----

  src/master/http.cpp a44621f39cb059e654a56f57f75b38947f3a4230 
  src/master/quota_handler.cpp 6e6e7375219d34e6e8d011a025b5f5d70b87383b 
  src/master/validation.cpp 5f134b781901f2de6a90fa6a10d42cc7629c27a0 

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


Testing
-------

The existing tests pass at the end of this review chain.


Thanks,

Benjamin Mahler


Re: Review Request 55970: Updated the master's HTTP operations to handle MULTI_ROLE changes.

Posted by Benjamin Mahler <bm...@apache.org>.

> On Jan. 31, 2017, 6:32 p.m., Michael Park wrote:
> > src/master/validation.cpp, lines 1674-1700
> > <https://reviews.apache.org/r/55970/diff/1/?file=1616023#file1616023line1674>
> >
> >     It's not clear to me why we need to unallocate the resources.
> >     
> >     Presumably the resources in `Offer::Operation`, and the resources in `usedResources` should have the same `AllocationInfo` set? Is this not the case?

There are two cases:

(1) Allocated operation (framework accept)
(2) Unallocated operation (http endpoint)

Case 1 would be handled without changes but case 2 is not handled, so my approach is to unallocate both to perform the contains check, since we're only interested in the case where the volume is already in use. I'll add a comment to clarify this.


- Benjamin


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


On Jan. 26, 2017, 1:08 a.m., Benjamin Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55970/
> -----------------------------------------------------------
> 
> (Updated Jan. 26, 2017, 1:08 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Jay Guo, Guangya Liu, and Michael Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> With the addition of MULTI_ROLE framework support, allocated
> resources in the master have `Resource.AllocationInfo` set. This
> means that the master's http endpoints that apply operations or
> perform checks between unallocated and allocated resources must
> be updated to continue to function correctly.
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp a44621f39cb059e654a56f57f75b38947f3a4230 
>   src/master/quota_handler.cpp 6e6e7375219d34e6e8d011a025b5f5d70b87383b 
>   src/master/validation.cpp 5f134b781901f2de6a90fa6a10d42cc7629c27a0 
> 
> Diff: https://reviews.apache.org/r/55970/diff/
> 
> 
> Testing
> -------
> 
> The existing tests pass at the end of this review chain.
> 
> 
> Thanks,
> 
> Benjamin Mahler
> 
>


Re: Review Request 55970: Updated the master's HTTP operations to handle MULTI_ROLE changes.

Posted by Michael Park <mp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55970/#review163687
-----------------------------------------------------------


Fix it, then Ship it!





src/master/validation.cpp (lines 1674 - 1700)
<https://reviews.apache.org/r/55970/#comment235160>

    It's not clear to me why we need to unallocate the resources.
    
    Presumably the resources in `Offer::Operation`, and the resources in `usedResources` should have the same `AllocationInfo` set? Is this not the case?


- Michael Park


On Jan. 25, 2017, 5:08 p.m., Benjamin Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55970/
> -----------------------------------------------------------
> 
> (Updated Jan. 25, 2017, 5:08 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Jay Guo, Guangya Liu, and Michael Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> With the addition of MULTI_ROLE framework support, allocated
> resources in the master have `Resource.AllocationInfo` set. This
> means that the master's http endpoints that apply operations or
> perform checks between unallocated and allocated resources must
> be updated to continue to function correctly.
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp a44621f39cb059e654a56f57f75b38947f3a4230 
>   src/master/quota_handler.cpp 6e6e7375219d34e6e8d011a025b5f5d70b87383b 
>   src/master/validation.cpp 5f134b781901f2de6a90fa6a10d42cc7629c27a0 
> 
> Diff: https://reviews.apache.org/r/55970/diff/
> 
> 
> Testing
> -------
> 
> The existing tests pass at the end of this review chain.
> 
> 
> Thanks,
> 
> Benjamin Mahler
> 
>


Re: Review Request 55970: Updated the master's HTTP operations to handle MULTI_ROLE changes.

Posted by Benjamin Mahler <bm...@apache.org>.

> On Jan. 28, 2017, 3:25 p.m., Guangya Liu wrote:
> > src/master/validation.cpp, lines 1654-1667
> > <https://reviews.apache.org/r/55970/diff/1/?file=1616023#file1616023line1654>
> >
> >     Did not quite catch up the `TODO` here, can you please elaborate for why want such a function?

We have a few transformation functions:

`flatten()` which is a bit unintuitive,
`createStrippedScalarQuantity()` which makes some decisions about what to strip

It would be nice if we had a pattern for applying transformations that made it clearer what we're stripping. I'm just pointing out that unallocate falls under ths same pattern.

I was hesitant to pull out `unallocated()` because our current naming convention is that past-tense verbs peform filtering. So a `Resources::unallocated()` would just return those resources that are unallocated rather than a copy with the allocation stripped. I think we need something like `resources::transformations::unallocated()` or `Resources::transformed()`.


> On Jan. 28, 2017, 3:25 p.m., Guangya Liu wrote:
> > src/master/quota_handler.cpp, lines 196-200
> > <https://reviews.apache.org/r/55970/diff/1/?file=1616022#file1616022line196>
> >
> >     Per the comments in /r/55870/ , how about move this to resources_utils.cpp?

I would like to pull something shared out for this, but see my comment below for why I held off for now.


> On Jan. 28, 2017, 3:25 p.m., Guangya Liu wrote:
> > src/master/http.cpp, lines 4614-4615
> > <https://reviews.apache.org/r/55970/diff/1/?file=1616021#file1616021line4614>
> >
> >     I think this can be replaced by the util function in below comments?

Hm.. I didn't quite follow your suggestion here.


- Benjamin


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


On Jan. 26, 2017, 1:08 a.m., Benjamin Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55970/
> -----------------------------------------------------------
> 
> (Updated Jan. 26, 2017, 1:08 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Jay Guo, Guangya Liu, and Michael Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> With the addition of MULTI_ROLE framework support, allocated
> resources in the master have `Resource.AllocationInfo` set. This
> means that the master's http endpoints that apply operations or
> perform checks between unallocated and allocated resources must
> be updated to continue to function correctly.
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp a44621f39cb059e654a56f57f75b38947f3a4230 
>   src/master/quota_handler.cpp 6e6e7375219d34e6e8d011a025b5f5d70b87383b 
>   src/master/validation.cpp 5f134b781901f2de6a90fa6a10d42cc7629c27a0 
> 
> Diff: https://reviews.apache.org/r/55970/diff/
> 
> 
> Testing
> -------
> 
> The existing tests pass at the end of this review chain.
> 
> 
> Thanks,
> 
> Benjamin Mahler
> 
>


Re: Review Request 55970: Updated the master's HTTP operations to handle MULTI_ROLE changes.

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




src/master/http.cpp (lines 4614 - 4615)
<https://reviews.apache.org/r/55970/#comment234865>

    I think this can be replaced by the util function in below comments?



src/master/quota_handler.cpp (lines 196 - 200)
<https://reviews.apache.org/r/55970/#comment234864>

    Per the comments in /r/55870/ , how about move this to resources_utils.cpp?



src/master/validation.cpp (lines 1654 - 1667)
<https://reviews.apache.org/r/55970/#comment234867>

    Did not quite catch up the `TODO` here, can you please elaborate for why want such a function?



src/master/validation.cpp (line 1718)
<https://reviews.apache.org/r/55970/#comment234866>

    How about 
    
    ```
    if (unallocated(resources).contains(volume)) {
    ```
    
    and then kill #1715 ?


- Guangya Liu


On \u4e00\u6708 26, 2017, 1:08 a.m., Benjamin Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55970/
> -----------------------------------------------------------
> 
> (Updated \u4e00\u6708 26, 2017, 1:08 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Jay Guo, Guangya Liu, and Michael Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> With the addition of MULTI_ROLE framework support, allocated
> resources in the master have `Resource.AllocationInfo` set. This
> means that the master's http endpoints that apply operations or
> perform checks between unallocated and allocated resources must
> be updated to continue to function correctly.
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp a44621f39cb059e654a56f57f75b38947f3a4230 
>   src/master/quota_handler.cpp 6e6e7375219d34e6e8d011a025b5f5d70b87383b 
>   src/master/validation.cpp 5f134b781901f2de6a90fa6a10d42cc7629c27a0 
> 
> Diff: https://reviews.apache.org/r/55970/diff/
> 
> 
> Testing
> -------
> 
> The existing tests pass at the end of this review chain.
> 
> 
> Thanks,
> 
> Benjamin Mahler
> 
>


Re: Review Request 55970: Updated the master's HTTP operations to handle MULTI_ROLE changes.

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



Bad patch!

Reviews applied: [55970, 55969, 55968, 55967, 55870, 55910, 55909, 55908, 55868, 55824, 55866, 55863, 55828, 55829, 55827, 55826, 55825, 54836, 54842]

Failed command: python support/apply-reviews.py -n -r 55870

Error:
2017-01-26 04:26:10 URL:https://reviews.apache.org/r/55870/diff/raw/ [47956/47956] -> "55870.patch" [1]
error: patch failed: src/master/master.cpp:6528
error: src/master/master.cpp: patch does not apply

Full log: https://builds.apache.org/job/Mesos-Reviewbot/16857/console

- Mesos Reviewbot


On Jan. 26, 2017, 1:08 a.m., Benjamin Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55970/
> -----------------------------------------------------------
> 
> (Updated Jan. 26, 2017, 1:08 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Jay Guo, Guangya Liu, and Michael Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> With the addition of MULTI_ROLE framework support, allocated
> resources in the master have `Resource.AllocationInfo` set. This
> means that the master's http endpoints that apply operations or
> perform checks between unallocated and allocated resources must
> be updated to continue to function correctly.
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp a44621f39cb059e654a56f57f75b38947f3a4230 
>   src/master/quota_handler.cpp 6e6e7375219d34e6e8d011a025b5f5d70b87383b 
>   src/master/validation.cpp 5f134b781901f2de6a90fa6a10d42cc7629c27a0 
> 
> Diff: https://reviews.apache.org/r/55970/diff/
> 
> 
> Testing
> -------
> 
> The existing tests pass at the end of this review chain.
> 
> 
> Thanks,
> 
> Benjamin Mahler
> 
>