> On April 26, 2017, 7:26 p.m., Neil Conway wrote:
> > Hey Anindya -- can you rebase this RR for the recent sorter changes? I
> > should be able to review and commit it shortly after that.
Rebased this patch.
btw, `SorterTest.HierarchicalAllocation()` has the following call to
`sorter.update()`:
```
sorter.update("b/c", slaveId, cResources, cNewResources);
```
which updates the sorter from `cResources` of `cpus(*):4;mem(*):4` to
`cNewResources` of `cpus(*):1;mem(*):1`. This obviously changes the `totals`
and hence the `dirty` flag needs to be set.
However, `DRFSorter::update()` is only called from
`HierarchicalAllocatorProcess::updateAllocation()` for each of the role sorters
and IIUC, there should not be a case when the `totals` would actually change.
So, I was of the opinion of putting in a check invariant in
`Node::Allocation::update()` but obviously that would be a problem for this
test. So, as of now, I added a check that if `totals` changes, we set the
`dirty` flag.
- Anindya
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57935/#review173081
-----------------------------------------------------------
On April 27, 2017, 5:35 p.m., Anindya Sinha wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/57935/
> -----------------------------------------------------------
>
> (Updated April 27, 2017, 5:35 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
> a8b35c4deac7a4f0725ccae517a8cbca5b8e1ee7
>
>
> Diff: https://reviews.apache.org/r/57935/diff/2/
>
>
> Testing
> -------
>
> All tests passed.
>
>
> Thanks,
>
> Anindya Sinha
>
>