swift-ring-builder inconsistent behavior if only devices with 0 weight in the ring
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
In Progress
|
Low
|
Christian Schwede |
Bug Description
When there are only devices with a weight of 0 left in the ring the swift-ring-builder CLI
raises an exception. However, without any device in the ring this doesn't happen and the output simply tells me there are 0 devices in the ring:
[stack@undercloud tmp]$ swift-ring-builder sample.builder create 8 1 0
[stack@undercloud tmp]$ swift-ring-builder sample.builder
sample.builder, build version 0
256 partitions, 1.000000 replicas, 0 regions, 0 zones, 0 devices, 0.00 balance, 0.00 dispersion
The minimum number of hours before a partition can be reassigned is 0 (0:00:00 remaining)
The overload factor is 0.00% (0.000000)
Ring file sample.ring.gz is obsolete
Now let's add a device with a weight of 0:
[stack@undercloud tmp]$ swift-ring-builder sample.builder add r1z1-127.
Device d0r1z1-
And try to output the builder again:
[stack@undercloud tmp]$ swift-ring-builder sample.builder
sample.builder, build version 1
Traceback (most recent call last):
File "/usr/bin/
sys.
File "/usr/lib/
getattr(
File "/usr/lib/
balance = builder.
File "/usr/lib/
balance_per_dev = self._build_
File "/usr/lib/
weight_
File "/usr/lib/
raise exceptions.
swift.common.
This is wrong (there is an device), but also an inconsistent behaviour. Even if it would be true that there is no device, the ring-builder shouldn't raise an exception in some cases - either never, or always.
Changed in swift: | |
status: | New → In Progress |
summary: |
- swift-ring-builder incosistend behavior if only devices with 0 weight in - the ring + swift-ring-builder inconsistent behavior if only devices with 0 weight + in the ring |