commit 3c0cf549f1e822cce8f905b069b317e676cf306b
Author: Samuel Merritt <email address hidden>
Date: Wed Jan 13 18:08:45 2016 -0800
Speed up get_more_nodes() when there is an empty zone
The ring has some optimizations in get_more_nodes() so that it can
find handoffs that span all the regions/zones/et cetera and then stop
looking. The stopping is the important part.
Previously, it would quickly find a handoff in each unused region,
then spend way too long looking for more unused regions; the same was
true for zones, IPs, and so on. Thus, in commit 9cd7c6c, we started
counting regions and zones, then stopping when we found them all.
This count included all regions and zones in the ring, regardless of
whether or not there were actually any parts assigned or not. In rings
with an empty region, i.e. a region for which there are only
zero-weight devices, get_more_nodes() would be very slow.
This commit ignores devices with no assigned partitions when counting
regions, zones, and so forth, thus greatly speeding things up.
The output of get_more_nodes() is unchanged. This is purely an
optimization.
Reviewed: https:/ /review. openstack. org/267273 /git.openstack. org/cgit/ openstack/ swift/commit/ ?id=3c0cf549f1e 822cce8f905b069 b317e676cf306b
Committed: https:/
Submitter: Jenkins
Branch: master
commit 3c0cf549f1e822c ce8f905b069b317 e676cf306b
Author: Samuel Merritt <email address hidden>
Date: Wed Jan 13 18:08:45 2016 -0800
Speed up get_more_nodes() when there is an empty zone
The ring has some optimizations in get_more_nodes() so that it can
find handoffs that span all the regions/zones/et cetera and then stop
looking. The stopping is the important part.
Previously, it would quickly find a handoff in each unused region,
then spend way too long looking for more unused regions; the same was
true for zones, IPs, and so on. Thus, in commit 9cd7c6c, we started
counting regions and zones, then stopping when we found them all.
This count included all regions and zones in the ring, regardless of
whether or not there were actually any parts assigned or not. In rings
with an empty region, i.e. a region for which there are only
zero-weight devices, get_more_nodes() would be very slow.
This commit ignores devices with no assigned partitions when counting
regions, zones, and so forth, thus greatly speeding things up.
The output of get_more_nodes() is unchanged. This is purely an
optimization.
Closes-Bug: 1534303
Change-Id: I4a5c57205e87e1 205d40fd5d9458d 4114e524332