> On Jan. 19, 2016, 3:34 p.m., Joseph Wu wrote: > > src/master/allocator/mesos/hierarchical.cpp, line 676 > > <https://reviews.apache.org/r/41791/diff/8/?file=1196632#file1196632line676> > > > > I see several places where you overwrite changes from this review in > > the subsequent two. Did you mean to have three reviews for the changes to > > `::updateAllocation`, `::updateAvailable`, and `::recoverResources`? > > Guangya Liu wrote: > There are three patches handling dynamic reservation and > 1) https://reviews.apache.org/r/41791 Reserve new resources via > `updateAllocation` and `updateAvailable`. (1/3). > 2) https://reviews.apache.org/r/42113 Unreserve resources via > `updateAllocation` (2/3). > 3) https://reviews.apache.org/r/42194 Unreserve resources via > `updateAvailable` (3/3). > > I have updated the description here.
It doesn't seem like you need 3 patches. I'd recommend a couple of cleanups: * Add a helper for all the duplicate logic you have. Both `updateAllocation` and `updateAvailable` deal with reservations, in essentially the same way (per optimistic offers). * Consolidate the overlapping changes into a single patch. Just don't overwrite your own changes. * Consider a different approach than subtracting allocation slack on unreserve. You could perhaps, for accounting purposes, elevate a portion of the allocation from revocable to non-revocable. - Joseph ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/41791/#review115279 ----------------------------------------------------------- On Jan. 19, 2016, 10:38 p.m., Guangya Liu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/41791/ > ----------------------------------------------------------- > > (Updated Jan. 19, 2016, 10:38 p.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 > ------- > > Update allocation slack resources if reserve some new > stateless reserved resources. For such case, the allocation > slack resources will be increased. > > This patch updates both `updateAvailable` and `updateAllocation` > when reserving some new resources. > > There are three patches handling dynamic reservation and oo phase 1. > 1) https://reviews.apache.org/r/41791 Reserve new resources via > `updateAllocation` and `updateAvailable`. (1/3). > 2) https://reviews.apache.org/r/42113 Unreserve resources via > `updateAllocation` (2/3). > 3) https://reviews.apache.org/r/42194 Unreserve resources via > `updateAvailable` (3/3). > > > Diffs > ----- > > src/master/allocator/mesos/hierarchical.cpp > d541bfa3f4190865c65d35c9d1ffdb8a3f194056 > src/tests/hierarchical_allocator_tests.cpp > e044f832c2c16e53e663c6ced5452649bb0dcb59 > > Diff: https://reviews.apache.org/r/41791/diff/ > > > Testing > ------- > > make > make check > > > Thanks, > > Guangya Liu > >
