> On April 8, 2015, 11:49 p.m., Jie Yu wrote: > > src/common/resources.cpp, lines 442-445 > > <https://reviews.apache.org/r/32398/diff/2/?file=921003#file921003line442> > > > > Since we already have `isReserved`. How about calling it > > `isDynamicallyReserved`?
Good idea, Fixed :) > On April 8, 2015, 11:49 p.m., Jie Yu wrote: > > src/common/resources_utils.cpp, lines 45-65 > > <https://reviews.apache.org/r/32398/diff/2/?file=921004#file921004line45> > > > > So bad that we are effectively duplicating the logics in > > Resources::apply here. But I couldn't come up with a better way without > > introducing stripping. > > > > Maybe add a command about what we are doing here. We are effectively > > infering offer operations from checkpointed resources and apply them to the > > totalResources. I think one way to solve this is to introduce a `RESERVE_AND_CREATE` operation. Then our inference would be done in the following order: (1) `isDynamicallyReserved && isPersistentVolume` => `RESERVE_AND_CREATE` (2) `isDynamicallyReserved` => `RESERVE` (3) `isPersistentVolume` => `CREATE` In which case we could reuse `Resources::apply` here, and it would also allow users to avoid having to do a sequence of `RESERVE` followed by a `CREATE`. Just a thought for a possible solution. I've left a `NOTE` for why we do what we do here, and a `TODO` to consider introducing a `RESERVE_AND_CREATE`. - Michael ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/32398/#review79445 ----------------------------------------------------------- On May 11, 2015, 8:36 p.m., Michael Park wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/32398/ > ----------------------------------------------------------- > > (Updated May 11, 2015, 8:36 p.m.) > > > Review request for mesos and Alexander Rukletsov. > > > Bugs: MESOS-2491 > https://issues.apache.org/jira/browse/MESOS-2491 > > > Repository: mesos > > > Description > ------- > > * Added `isDynamicallyReserved(resource)` which returns true if the resource > is a dynamic reservation. > * Added the `isDynamicallyReserved` condition onto `needCheckpointing`. > * Updated the `applyCheckpointedResources` to consider dynamic reservations. > * Added tests. > > > Diffs > ----- > > include/mesos/resources.hpp 4c036d36e0e8ab3852786dd32b2d983d45891624 > src/common/resources.cpp 235930ff2dbb3ea49a3a0696dc070f2bd56fba4b > src/common/resources_utils.cpp fe04d57227fa193d6d11d2f76529c46aea74c6a1 > src/tests/reservation_tests.cpp PRE-CREATION > > Diff: https://reviews.apache.org/r/32398/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Michael Park > >