-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70429/
-----------------------------------------------------------
(Updated April 17, 2019, 11:29 a.m.)
Review request for mesos and Benjamin Mahler.
Changes
-------
Rephrased the summary and description as a bug fix. Also, fixed the broken test.
Summary (updated)
-----------------
Fixed a bug in the random sorter.
Bugs: MESOS-9733
https://issues.apache.org/jira/browse/MESOS-9733
Repository: mesos
Description (updated)
-------
Currently, in the presence of hierarchical roles, the
random sorter shuffles roles level by level and then pick
the active leave nodes using DFS. This could generate
non-uniform random result since active leaves in a subtree
are always picked together.
This patch fixes the issue by first calculating the relative
weights of each active leaf node and shuffle all of them
only once.
Diffs (updated)
-----
src/master/allocator/sorter/random/sorter.cpp
bbe130dbf3b158ea14f9572bc5d14200fcd85127
src/tests/sorter_tests.cpp 91bfde01b579a9892215593ab8d8b2d096788278
Diff: https://reviews.apache.org/r/70429/diff/3/
Changes: https://reviews.apache.org/r/70429/diff/2-3/
Testing
-------
make check
Tests for hierarchical roles in subsequent patches
Benchmarking:
Optimized build with
QuotaParam/BENCHMARK_HierarchicalAllocator_WithQuotaParam.LargeAndSmallQuota/2
## Before:
Added 3000 agents in 85.844373ms
Added 3000 frameworks in 19.713969615secs
Benchmark setup: 3000 agents, 3000 roles, 3000 frameworks
Made 3500 allocations in 13.690538305secs
Made 0 allocation in 9.76855825secs
## After:
Added 3000 agents in 93.482508ms
Added 3000 frameworks in 19.193235872secs
Benchmark setup: 3000 agents, 3000 roles, 3000 frameworks
Made 3500 allocations in 13.530734654secs
Made 0 allocation in 10.338803223secs
Thanks,
Meng Zhu