diff options
author | Clay Gerrard <clay.gerrard@gmail.com> | 2017-12-29 08:53:21 -0800 |
---|---|---|
committer | Clay Gerrard <clay.gerrard@gmail.com> | 2018-01-02 16:20:28 +0000 |
commit | 49de7db532ffaba9fbd3c7e912e007b9d8a36d7c (patch) | |
tree | bacdb6027115b4aa0feab8e597117248142286f1 /swift/common/ring/utils.py | |
parent | 7013e70ca67891e94664e9eca70925b61ee8f689 (diff) | |
download | swift-49de7db532ffaba9fbd3c7e912e007b9d8a36d7c.tar.gz |
add swift-ring-builder option to recalculate dispersion
Since dispersion info is cached, this can easily happen if we make
changes to how dispersion info is calculated or stored (e.g. we extend
the dispersion calculation to consider dispersion of all part-replicas
in the related change)
Related-Change-Id: Ifefff0260deac0c3e8b369a1e158686c89936686
Change-Id: I714deb9e349cd114a21ec591216a9496aaf9e0d1
Diffstat (limited to 'swift/common/ring/utils.py')
-rw-r--r-- | swift/common/ring/utils.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/swift/common/ring/utils.py b/swift/common/ring/utils.py index e763d2a4d..494264ac1 100644 --- a/swift/common/ring/utils.py +++ b/swift/common/ring/utils.py @@ -606,8 +606,9 @@ def build_dev_from_opts(opts): 'replication_port': replication_port, 'weight': opts.weight} -def dispersion_report(builder, search_filter=None, verbose=False): - if not builder._dispersion_graph: +def dispersion_report(builder, search_filter=None, + verbose=False, recalculate=False): + if recalculate or not builder._dispersion_graph: builder._build_dispersion_graph() max_allowed_replicas = builder._build_max_replicas_by_tier() worst_tier = None |