----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/57935/#review176687 -----------------------------------------------------------
src/master/allocator/sorter/drf/sorter.hpp Lines 346 (patched) <https://reviews.apache.org/r/57935/#comment250116> I think `totalChanged` would be a more idiomatic variable name. src/master/allocator/sorter/drf/sorter.hpp Lines 347 (patched) <https://reviews.apache.org/r/57935/#comment250122> Why is `flatten` necessary here? We are already comparing two scalar quantities, so is the flatten required? src/master/allocator/sorter/drf/sorter.hpp Lines 358 (patched) <https://reviews.apache.org/r/57935/#comment250123> I'd move the definition/calculation of `isTotalChanged` down here, to where it is used. src/master/allocator/sorter/drf/sorter.cpp Line 309 (original), 304 (patched) <https://reviews.apache.org/r/57935/#comment250127> src/master/allocator/sorter/drf/sorter.cpp Lines 307 (patched) <https://reviews.apache.org/r/57935/#comment250124> src/master/allocator/sorter/drf/sorter.cpp Lines 307 (patched) <https://reviews.apache.org/r/57935/#comment250125> src/master/allocator/sorter/drf/sorter.cpp Lines 307 (patched) <https://reviews.apache.org/r/57935/#comment250126> The return value of `update` depends only on the parameters `oldAllocation` and `newAllocation`, right? In which case, the way this is written seems confusing to me (e.g., it implies it would be possible for `dirty` to remain false when we start at a leaf node, but then for `dirty` to be true for an ancestor node). An improvement would be to `CHECK` that `update()` returns the same value for all the nodes in the path from leaf -> root. We could alternatively check whether the total allocation has changed outside `update` and only update `dirty` once. We could conceivably compute `oldAllocationQuantity` and `newAllocationQuantity` in `allocated` and pass them into `update` (for efficiency), but that is a bit ugly. Let me know what you think. - Neil Conway On May 11, 2017, 9:02 p.m., Anindya Sinha wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/57935/ > ----------------------------------------------------------- > > (Updated May 11, 2017, 9:02 p.m.) > > > Review request for mesos and Neil Conway. > > > Bugs: MESOS-7138 > https://issues.apache.org/jira/browse/MESOS-7138 > > > Repository: mesos > > > Description > ------- > > In `DRFSorter::update`, we should set the `dirty` flag only when the > total scalar quantities have changed in any of the cleints in the > hierarchy, and not always. > > > Diffs > ----- > > src/master/allocator/sorter/drf/sorter.hpp > fee58d6d1f08163e2a06a4a20c891fe535c3dcff > src/master/allocator/sorter/drf/sorter.cpp > 26b77f578f3235a8792c72d4575d607cdb2c7de7 > > > Diff: https://reviews.apache.org/r/57935/diff/3/ > > > Testing > ------- > > All tests passed. > > > Thanks, > > Anindya Sinha > >