Allow swift "min_part_hours" to be configurable
With swift rings, a "min_part_hours" value is required. This is the time (in hours) before a specific partition can be moved in succession (following a rebalance). Currently this value is hard-coded to 1 but this value is not feasible for a large system and it can often take several hours for partitions to re-align following a rebalance. Therefore, this change allows this value to be configurable by adding the "MIN_PART_HOURS" variable. If this change is accepted, I will add the relevant parameter in tripleo-heat-templates. Change-Id: Ie6438386a54794e1ae2f31ad925db01c2c10ed6d
This commit is contained in:
parent
bc3d153121
commit
c6f8b5d301
@ -7,6 +7,7 @@ PARTPOWER=$(os-apply-config --key swift.part-power --key-default 10)
|
||||
REPLICAS=$(os-apply-config --key swift.replicas --key-default 1)
|
||||
DEVICES=$(os-apply-config --key swift.devices --key-default "" --type raw)
|
||||
ZONES=$(os-apply-config --key swift.zones --key-default 1)
|
||||
MIN_PART_HOURS=$(os-apply-config --key swift.min-part-hours --key-default 1)
|
||||
BUILD_RINGS=$(os-apply-config --key swift.ring-build --key-default "True" | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
if [ "$BUILD_RINGS" == "false" ] || [ "$BUILD_RINGS" == "f" ]; then
|
||||
@ -37,9 +38,9 @@ if [ -z "$DEVICES" ] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
swift-ring-builder /etc/swift/object.builder create $PARTPOWER $REPLICAS 1
|
||||
swift-ring-builder /etc/swift/container.builder create $PARTPOWER $REPLICAS 1
|
||||
swift-ring-builder /etc/swift/account.builder create $PARTPOWER $REPLICAS 1
|
||||
swift-ring-builder /etc/swift/object.builder create $PARTPOWER $REPLICAS $MIN_PART_HOURS
|
||||
swift-ring-builder /etc/swift/container.builder create $PARTPOWER $REPLICAS $MIN_PART_HOURS
|
||||
swift-ring-builder /etc/swift/account.builder create $PARTPOWER $REPLICAS $MIN_PART_HOURS
|
||||
|
||||
# Function to place server in its zone. Zone is calculated by
|
||||
# server number in heat template modulo the number of zones + 1.
|
||||
|
Loading…
Reference in New Issue
Block a user