mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Meng Zhu <>
Subject Re: Review Request 70429: Fixed a bug in the random sorter.
Date Wed, 17 Apr 2019 18:29:28 GMT

This is an automatically generated e-mail. To reply, visit:

(Updated April 17, 2019, 11:29 a.m.)

Review request for mesos and Benjamin Mahler.


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

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 




make check
Tests for hierarchical roles in subsequent patches

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


Meng Zhu

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message