----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/63620/#review190350 -----------------------------------------------------------
src/master/master.cpp Line 9905 (original), 9969 (patched) <https://reviews.apache.org/r/63620/#comment267680> I think `checkpointedResources` should be limited to agent default resources. So we might want to tweak `needCheckpointing` filter. Also, I think we probably should consider using `_apply` for new operations too. With the above in mind, here, we probably need to adjust the code to only call `slave->apply(operation)` when the opreation is old operaitons because for new operations, slave's total doesn't change until terminal status update. src/master/master.cpp Lines 9974 (patched) <https://reviews.apache.org/r/63620/#comment267681> I'd prefer we use CHECK here and move the validation to caller (and drop there). And I am pretty sure this is validated in master operation validation. Utility functions like this should be kept without too many branches. src/master/master.cpp Lines 9980-9985 (patched) <https://reviews.apache.org/r/63620/#comment267682> YOu can use the following: ``` Option<UUID> resourceVersion = resourceProviderId.isSome() ? slave->resourceVersions.get(resourceProviderId.get()) : slave->resourceVersions.get(None()); ``` src/master/master.cpp Lines 9987-9995 (patched) <https://reviews.apache.org/r/63620/#comment267683> I would just use a CHECK_SOME here. - Jie Yu On Nov. 7, 2017, 2:18 p.m., Jan Schlicht wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/63620/ > ----------------------------------------------------------- > > (Updated Nov. 7, 2017, 2:18 p.m.) > > > Review request for mesos, Benjamin Bannier and Jie Yu. > > > Repository: mesos > > > Description > ------- > > Resource version UUIDs are used to establish a relationship between > operation and the resource they are operating on. For each agent the > master keeps track of its resource version and the resource version of > the agents' resource providers. As resource versions are required in a > 'ApplyOfferOperationMessage', the master has to find the resource > version that's matching the resources an operation should apply to and > set it accordingly. > > > Diffs > ----- > > src/master/master.cpp ee212c1a21b432d3aa8e90d748d12cb0a754d57c > > > Diff: https://reviews.apache.org/r/63620/diff/1/ > > > Testing > ------- > > make check > > > Thanks, > > Jan Schlicht > >
