swift-ring-builder sometimes uses .builder file when given .ring.gz and vice versa
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
Undecided
|
Christian Schwede |
Bug Description
Normally the swift-ring-builder command takes a .builder file as argument. However, if an operator uses a .ring.gz file as argument (intended or not) it will silently use a .builder file - but not in all cases.
For example:
vagrant@
object.builder
vagrant@
object.ring.gz, build version 4
1024 partitions, 3.000000 replicas, 1 regions, 4 zones, 4 devices, 0.00 balance, 0.00 dispersion
The minimum number of hours before a partition can be reassigned is 1
The overload factor is 0.00% (0.000000)
Devices: id region zone ip address port replication ip replication port name weight partitions balance meta
0 1 1 127.0.0.1 6010 127.0.0.1 6010 sdb1 1.00 768 0.00
1 1 2 127.0.0.1 6020 127.0.0.1 6020 sdb2 1.00 768 0.00
2 1 3 127.0.0.1 6030 127.0.0.1 6030 sdb3 1.00 768 0.00
3 1 4 127.0.0.1 6040 127.0.0.1 6040 sdb4 1.00 768 0.00
-> The file object.ring.gz doesn't even exist; there is no error, and the output even reports that object.ring.gz has been used.
Another one:
vagrant@
object.builder object.ring.gz
vagrant@
Device d4r1z1-
-> Device added, but where?
vagrant@
object.builder, build version 4
1024 partitions, 3.000000 replicas, 1 regions, 4 zones, 4 devices, 0.00 balance, 0.00 dispersion
The minimum number of hours before a partition can be reassigned is 1
The overload factor is 0.00% (0.000000)
Devices: id region zone ip address port replication ip replication port name weight partitions balance meta
0 1 1 127.0.0.1 6010 127.0.0.1 6010 sdb1 1.00 768 0.00
1 1 2 127.0.0.1 6020 127.0.0.1 6020 sdb2 1.00 768 0.00
2 1 3 127.0.0.1 6030 127.0.0.1 6030 sdb3 1.00 768 0.00
3 1 4 127.0.0.1 6040 127.0.0.1 6040 sdb4 1.00 768 0.00
The next command uses actually the .builder file, not helpful in this case:
vagrant@
object.ring.gz, build version 4
1024 partitions, 3.000000 replicas, 1 regions, 4 zones, 4 devices, 0.00 balance, 0.00 dispersion
The minimum number of hours before a partition can be reassigned is 1
The overload factor is 0.00% (0.000000)
Devices: id region zone ip address port replication ip replication port name weight partitions balance meta
0 1 1 127.0.0.1 6010 127.0.0.1 6010 sdb1 1.00 768 0.00
1 1 2 127.0.0.1 6020 127.0.0.1 6020 sdb2 1.00 768 0.00
2 1 3 127.0.0.1 6030 127.0.0.1 6030 sdb3 1.00 768 0.00
3 1 4 127.0.0.1 6040 127.0.0.1 6040 sdb4 1.00 768 0.00
The added device actually ended up in the .ring.gz file, which is no longer a ring file, but a builder file:
vagrant@
vagrant@
object.builder, build version 5
1024 partitions, 3.000000 replicas, 1 regions, 4 zones, 5 devices, 2500.00 balance, 0.00 dispersion
The minimum number of hours before a partition can be reassigned is 1
The overload factor is 0.00% (0.000000)
Devices: id region zone ip address port replication ip replication port name weight partitions balance meta
0 1 1 127.0.0.1 6010 127.0.0.1 6010 sdb1 1.00 768 2500.00
1 1 2 127.0.0.1 6020 127.0.0.1 6020 sdb2 1.00 768 2500.00
2 1 3 127.0.0.1 6030 127.0.0.1 6030 sdb3 1.00 768 2500.00
3 1 4 127.0.0.1 6040 127.0.0.1 6040 sdb4 1.00 768 2500.00
4 1 1 127.0.0.1 6000 127.0.0.1 6000 sde1 100.00 0 -100.00
The reason for this behavior is that in very rare cases the argv[1] is translated, but rarely used.
CVE References
Changed in swift: | |
milestone: | none → 2.4.0 |
status: | Fix Committed → Fix Released |
Fix proposed to branch: master /review. openstack. org/209787
Review: https:/