> On 一月 7, 2016, 8:22 p.m., Joseph Wu wrote:
> > src/master/allocator/mesos/hierarchical.cpp, lines 438-443
> > <https://reviews.apache.org/r/40632/diff/10/?file=1180362#file1180362line438>
> >
> >     Resources can be dynamically reserved, so ideally, you should 
> > recalculating the allocation slack in someplace like `updateAllocation`.  
> > The `RESERVE` operation specifically increases allocation slack.

Patch is here https://reviews.apache.org/r/41791/


> On 一月 7, 2016, 8:22 p.m., Joseph Wu wrote:
> > src/master/allocator/mesos/hierarchical.cpp, line 516
> > <https://reviews.apache.org/r/40632/diff/10/?file=1180362#file1180362line516>
> >
> >     The Oversubscription logic here will overwrite anything you've done in 
> > `::addSlave`.

Patch is here https://reviews.apache.org/r/41847/


> On 一月 7, 2016, 8:22 p.m., Joseph Wu wrote:
> > src/master/allocator/mesos/hierarchical.cpp, lines 1305-1313
> > <https://reviews.apache.org/r/40632/diff/10/?file=1180362#file1180362line1305>
> >
> >     If you make the changes above, this recalculation will be unnecessary.  
> > `resources.allocationSlack()` should be sufficient.

`resources.allocationSlack()` may not enough. If some task run on stateless 
reserved resources, the allocator should also remove those resources from 
allocation slack.

i.e.
total resources: 
`cpus(role1):100;mem(role1):100;cpus(*){ALLOCATION_SLACK}:100;mem(*){ALLOCATION_SLACK}:100`
allocated: `cpus(role1):30;mem(*){ALLOCATION_SLACK}:20`
Then the available resources should be: 
`cpus(role1):70;mem(role1):100;cpus(*){ALLOCATION_SLACK}:70;mem(*){ALLOCATION_SLACK}:80`

The allocation slack for cpus was also updated by decreasing 30 due to 
stateless reserved resources are used.


> On 一月 7, 2016, 8:22 p.m., Joseph Wu wrote:
> > src/master/allocator/mesos/hierarchical.cpp, lines 1343-1360
> > <https://reviews.apache.org/r/40632/diff/10/?file=1180362#file1180362line1343>
> >
> >     There would be less code duplication if you did something like:
> >     ```
> >     if (!remainingAllocationSlack.empty()) {
> >       resources = remainingAllocationSlack;
> >     } else {
> >       continue;
> >     }
> >     ```

Cool!


- Guangya


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


On 一月 7, 2016, 11:27 a.m., Guangya Liu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40632/
> -----------------------------------------------------------
> 
> (Updated 一月 7, 2016, 11:27 a.m.)
> 
> 
> Review request for mesos, Ben Mahler, Artem Harutyunyan, Joris Van 
> Remoortere, Joseph Wu, Klaus Ma, and Jian Qiu.
> 
> 
> Bugs: MESOS-4145
>     https://issues.apache.org/jira/browse/MESOS-4145
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Enabled oversubscribed resources for reservations in allocator.
> 
> 
> Diffs
> -----
> 
>   src/master/allocator/mesos/hierarchical.cpp 
> df8bccaf2b8cfc0cb5ca18d4867371ae7a84c12f 
>   src/tests/hierarchical_allocator_tests.cpp 
> e044f832c2c16e53e663c6ced5452649bb0dcb59 
> 
> Diff: https://reviews.apache.org/r/40632/diff/
> 
> 
> Testing
> -------
> 
> make
> make check
> 
> 
> Thanks,
> 
> Guangya Liu
> 
>

Reply via email to