Activity log for bug #1396841

Date Who What changed Old value New value Message
2014-11-27 01:44:20 clayg bug added bug
2014-12-02 01:35:56 clayg description You can't rebalance an empty builder, because you can't have zero devices in a ring. Even if rebalance worked validate is gunna check you have devices, because you can't have a zero devices in a ring. You can't remove a device if it's the last one, because you dan't have zero devices in a ring. You can't set the weight of all devices to 0, because you can't have zero devices in a ring. If you try use write_ring on an empty builder, you get a *warning*, because you can't have zero devices in the ring... ... but it still does it - and you get a ring with zero devices. I'm not sure exactly the history behind the write_ring's insane ability to create these quite useless bytes on disk - but from a code sanity point of view I think it would drastically better if most of the checks there that ever so carefully going about printing the *warning* were dropped right down into RingBuilder.get_ring and pushed out as *exceptions*. Removing the ability entirely to have an invalid set of RingData on which write_ring can call save. Swift definitely can't make any use of these empty rings, and it blows up in terrible Index/ValueError-y ways if you give it rings that didn't get proper validation. If anyone ever things they *really* need an empty Ring on disk - they can run this: >>> from swift.common.ring import RingData >>> part_power = 10 >>> RingData([], [], part_power).save('footgun.ring.gz') But let's not let RingBuilder give it up without a fight. You can't rebalance an empty builder, because you can't have zero devices in a ring. Even if rebalance worked validate is gunna check you have devices, because you can't have a zero devices in a ring. You can't remove a device if it's the last one, because you dan't have zero devices in a ring. You can't set the weight of all devices to 0, because you can't have zero devices in a ring. If you try use write_ring on an empty builder, you get a *warning*, because you can't have zero devices in the ring... ... but it still does it - and you get a ring with zero devices. I'm not sure exactly the history behind the write_ring's insane ability to create these quite useless bytes on disk - but from a code sanity point of view I think it would drastically better if most of the checks there that are ever so carefully going about printing the *warning* were dropped right down into RingBuilder.get_ring and pushed out as *exceptions*. Removing the ability entirely to have an invalid set of RingData on which write_ring can call save. Swift definitely can't make any use of these empty rings, and it blows up in terrible Index/ValueError-y ways if you give it rings that didn't get proper validation. If anyone ever thinks they *really* need an empty Ring on disk - they can run this:     >>> from swift.common.ring import RingData     >>> part_power = 10     >>> RingData([], [], part_power).save('footgun.ring.gz') But let's not let RingBuilder give it up without a fight.
2017-09-11 21:51:56 Alistair Coles swift: status New Confirmed
2017-09-11 21:53:21 Alistair Coles swift: importance Undecided Low
2017-12-04 13:53:28 Christopher Bartz swift: assignee Christopher Bartz (bartz)
2017-12-04 13:54:18 OpenStack Infra swift: status Confirmed In Progress
2017-12-13 05:00:23 OpenStack Infra swift: status In Progress Fix Released
2017-12-21 20:56:50 OpenStack Infra tags in-feature-s3api
2018-01-02 21:29:27 OpenStack Infra tags in-feature-s3api in-feature-deep in-feature-s3api