mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Mahler <bmah...@apache.org>
Subject Re: Review Request 66044: Refactored resources chopping logic in allocator.
Date Wed, 11 Apr 2018 00:28:37 GMT


> On April 10, 2018, 10 p.m., Benjamin Mahler wrote:
> > src/master/allocator/mesos/hierarchical.cpp
> > Lines 1607-1610 (patched)
> > <https://reviews.apache.org/r/66044/diff/2/?file=1982719#file1982719line1607>
> >
> >     I assume this continues to work as the value scalar goes negative? We should
probably pull this up into the header and unit test it?
> 
> Meng Zhu wrote:
>     By "continues to work", I guess you expect the function to ignore negative shrink?
Then no, current `Resources::shrink()` will return a `Resource` object with negative values
with the same meta-data (if shrinkable).
>     
>     https://github.com/apache/mesos/blob/88f5629e510d71a32bd7e0ff7ee09e150f944e72/src/v1/resources.cpp#L1296-L1315
>     
>     I can fix that in a separate patch (if negative return directly).
>     
>     Though I think in most use cases, the scalar values will most likely come from another
resource(s) object, I do not think a negative resource object can be created easily (unless
intensionally).

Oh I see now that the loop won't produce negative scalars, nevermind :)


- Benjamin


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


On April 10, 2018, 10:54 p.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66044/
> -----------------------------------------------------------
> 
> (Updated April 10, 2018, 10:54 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Kapil Arya, Joseph Wu, Michael Park, and Till
Toenshoff.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Introduced a `shrinkResources()` lambda in allocator
> so that the same resource chopping logic can be re-used
> in the future, in particular, when introducing the quota
> limit.
> 
> 
> Diffs
> -----
> 
>   src/master/allocator/mesos/hierarchical.cpp 32e88952101d8dbbae9728478b1f5663bf46c3bb

> 
> 
> Diff: https://reviews.apache.org/r/66044/diff/3/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


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