Updates swift_ring_builder rebalancing parsing to support the
latest upstream replicator_id and replicator_port changes.
This correspondes with swift 1.8+ upstream development.
Fixes LP Bug #1182197.
Change-Id: Ibbaf75ca22cad95b22f9b5f03b547db8c47a9ea4
In some case, there are no spaces before - of the balance in swift 1.8.
The change fix this.
/etc/swift/object.builder, build version 9
32768 partitions, 3.000000 replicas, 1 regions, 3 zones, 9 devices, 200.00 balance
The minimum number of hours before a partition can be reassigned is 24
Devices: id region zone ip address port name weight partitions balance meta
0 1 1 10.68.0.45 6000 sdd 100.00 32768 200.00
1 1 2 10.68.0.46 6000 sdd 100.00 0-100.00
...
Change-Id: Ic7757a22ce94e4d51ae11780d4626c90a9ed430f
Updates the swift_ring_builder so that it parses ring builder output
from the most recent Swift releases correctly (1.7.6 or greated).
Backward compat for the previous parsing is still supported.
Change-Id: I4263b349310e16f6825960805eb27e4bfe3ff002
Previously, the Puppet modules only supported a single device per
endpoint.
This commits allows multiple devices per endpoint by making the device
name a part of the namevar for the swift ring devices.
it also updates the relevent configs.
Previously, the swift caches were being built on the class
instances themselves.
This could result in stale values when puppet runs multiple times
using the same process (like in the case of puppet agent)
This commit uses prefetch to ensure that the retrieved swift ring
values are updated per puppet run.
The swift ring db converts integers into floats with 2 decimal
points percisions. This was causing the ring resources to constantly
resync.
This commit munges weight in the type to the proper format.
The code was not robust when no
rows were returned from
swift_ringbuilder(builder_file_path).
The calls to retrieve an array range from the
array of this commands output was returning nil
which caused the failure: undef method each on nil
This change explicitly checks for the case where
there are no rows returned by swift-ring-builder.
This commit adds a class, defined resources and
native types that can be used together to manage
the creation, configuration, and rebalancing of
rings.
Creates the following native types:
ring_account_device
ring_container_device
ring_object_device
The implementation of these types is provided
by swift-ring-builder and most of the functionality
is provided by the parent provider (SwiftRingBuilder)
Each of the providers is hard-coded to find the
relevent ring database in /etc/swift. This directory
location can currently not be configured.
Each provider implements self.instances so the
current state can of the ring can be queried from
puppet.
These providers do not handle either the creation
or the rebalancing of the rings, they are intended
to be used in combination with defined resource types
that perform that functionality:
swift::ringbuilder::create
swift::ringbuilder::rebalance
The swift::ringbuilder class is also created as
a part of this commit. This class does the following:
- creates object, account, and container rings
(it uses the same parameters to create these rings)
- creates the rebalance defines
- sets up the following relationships:
for each ring type, create should be applied before
the native types which should refresh the rebalance