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
This commit is contained in:
parent
ddb937cfc5
commit
a7e0a9d57d
@ -126,8 +126,8 @@ def container_dispersion_report(coropool, connpool, account, container_ring,
|
|||||||
container_parts = {}
|
container_parts = {}
|
||||||
for container in containers:
|
for container in containers:
|
||||||
part, nodes = container_ring.get_nodes(account, container)
|
part, nodes = container_ring.get_nodes(account, container)
|
||||||
container_copies_expected[0] += len(nodes)
|
|
||||||
if part not in container_parts:
|
if part not in container_parts:
|
||||||
|
container_copies_expected[0] += len(nodes)
|
||||||
container_parts[part] = part
|
container_parts[part] = part
|
||||||
coropool.spawn(direct, container, part, nodes)
|
coropool.spawn(direct, container, part, nodes)
|
||||||
coropool.waitall()
|
coropool.waitall()
|
||||||
@ -231,8 +231,8 @@ def object_dispersion_report(coropool, connpool, account, object_ring,
|
|||||||
object_parts = {}
|
object_parts = {}
|
||||||
for obj in objects:
|
for obj in objects:
|
||||||
part, nodes = object_ring.get_nodes(account, container, obj)
|
part, nodes = object_ring.get_nodes(account, container, obj)
|
||||||
object_copies_expected[0] += len(nodes)
|
|
||||||
if part not in object_parts:
|
if part not in object_parts:
|
||||||
|
object_copies_expected[0] += len(nodes)
|
||||||
object_parts[part] = part
|
object_parts[part] = part
|
||||||
coropool.spawn(direct, obj, part, nodes)
|
coropool.spawn(direct, obj, part, nodes)
|
||||||
coropool.waitall()
|
coropool.waitall()
|
||||||
|
Loading…
Reference in New Issue
Block a user