From a7e0a9d57d87eb3cae6bd4baa2b080a3cf4a36f4 Mon Sep 17 00:00:00 2001 From: Samuel Merritt Date: Fri, 17 Jan 2014 11:45:57 -0800 Subject: [PATCH] Fix swift-dispersion-report when partitions overlap swift-dispersion-report tries to avoid checking a partition more than once, so it keeps track of partitions already queried and skips duplicates. swift-dispersion-report also keeps track of the number of successful responses; it counts the number of expected replicas to find, and also counts the number of replicas actually found, and tells the operator if the numbers differ. However, in the case that a partition was duplicated, the expected-responses counter was incremented, but the actual check was skipped, so it looked as though some copies were missing. Now we only increment the expected-responses counter if we're actually going to perform the check. Change-Id: I22ac2b8066b62ca7c8ebf099c9f602118bb1a298 --- bin/swift-dispersion-report | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/swift-dispersion-report b/bin/swift-dispersion-report index 764075b408..aabea6c502 100755 --- a/bin/swift-dispersion-report +++ b/bin/swift-dispersion-report @@ -126,8 +126,8 @@ def container_dispersion_report(coropool, connpool, account, container_ring, container_parts = {} for container in containers: part, nodes = container_ring.get_nodes(account, container) - container_copies_expected[0] += len(nodes) if part not in container_parts: + container_copies_expected[0] += len(nodes) container_parts[part] = part coropool.spawn(direct, container, part, nodes) coropool.waitall() @@ -231,8 +231,8 @@ def object_dispersion_report(coropool, connpool, account, object_ring, object_parts = {} for obj in objects: part, nodes = object_ring.get_nodes(account, container, obj) - object_copies_expected[0] += len(nodes) if part not in object_parts: + object_copies_expected[0] += len(nodes) object_parts[part] = part coropool.spawn(direct, obj, part, nodes) coropool.waitall()