From c6f8b5d301147db9d9e4870e9c08372306b21b1e Mon Sep 17 00:00:00 2001 From: Lorcan Date: Thu, 4 Sep 2014 10:58:36 +0100 Subject: [PATCH] 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 --- elements/swift/os-refresh-config/configure.d/73-swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/elements/swift/os-refresh-config/configure.d/73-swift b/elements/swift/os-refresh-config/configure.d/73-swift index abd9d2d4a..f743003f8 100755 --- a/elements/swift/os-refresh-config/configure.d/73-swift +++ b/elements/swift/os-refresh-config/configure.d/73-swift @@ -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.