swift/test/unit/common/ring
Kota Tsuyuzaki 2321966456 Accept a trade off of dispersion for balance
... but only if we *have* to!

During the initial gather for balance we prefer to avoid replicas on
over-weight devices that are already under-represented in any of it's
tiers (i.e. if a zone has to have at least one, but may have as many of
two, don't take the only replica).  Instead we hope by going for
replicas on over-weight devices that are at the limits of their
dispersion we might have a better than even chance we find a better
place for them during placement!

This normally works on out - and especially so for rings which can
disperse and balance.  But for existing rings where we'd have to
sacrifice dispersion to improve balance the existing optimistic gather
will end up refusing to trade dispersion for balance - and instead get
stuck without solving either!

You should always be able to solve for *either* dispersion or balance.
But if you can't solve *both* - we bail out on our optimistic gather
much more quickly and instead just focus on improving balance.  With
this change, the ring can get into balanced (and un-dispersed) states
much more quickly!

Change-Id: I17ac627f94f64211afaccad15596a9fcab2fada2
Related-Change-Id: Ie6e2d116b65938edac29efa6171e2470bb3e8e12
Closes-Bug: 1699636
Closes-Bug: 1701472
2017-09-25 12:37:49 -07:00
..
__init__.py Initial commit of Swift code 2010-07-12 17:03:45 -05:00
test_builder.py Accept a trade off of dispersion for balance 2017-09-25 12:37:49 -07:00
test_composite_builder.py Accept a trade off of dispersion for balance 2017-09-25 12:37:49 -07:00
test_ring.py Make test_get_more_nodes_with_zero_weight_region more robust 2017-08-11 09:53:20 -07:00
test_utils.py Accept a trade off of dispersion for balance 2017-09-25 12:37:49 -07:00