Browse code

Set the Swift max_file_size to 1/2 the loopback

Currently Devstack (and devstack gate) uses the default
max_file_size of for Swift (5GB). However the loopback file
is only 1 or 2 GB is size.

We are looking at setting a default FALLOCATE_RESERVE in swift
https://review.openstack.org/#/c/288011.
Because of this our max file size test fails due to the max_file_size
and devstacks loopback size being too small.

This patch sets this to a more sane size by default inside DevStack.
See the gerrit link above for more details.

Tempest uses a loopback of 6GB, so in this case the swift default of 5GB
should be fine.

Change-Id: If09eab7d16ae67bd252020e00e8812ff252f065b

Matthew Oliver authored on 2016/03/07 16:21:29
Showing 1 changed files
... ...
@@ -71,17 +71,20 @@ if is_service_enabled g-api; then
71 71
     # only 1G we can not upload volume to image.
72 72
     # Increase Swift disk size up to 2G
73 73
     SWIFT_LOOPBACK_DISK_SIZE_DEFAULT=2G
74
+    SWIFT_MAX_FILE_SIZE_DEFAULT=1073741824 # 1G
74 75
 else
75 76
     # DevStack will create a loop-back disk formatted as XFS to store the
76 77
     # swift data. Set ``SWIFT_LOOPBACK_DISK_SIZE`` to the disk size in
77 78
     # kilobytes.
78 79
     # Default is 1 gigabyte.
79 80
     SWIFT_LOOPBACK_DISK_SIZE_DEFAULT=1G
81
+    SWIFT_MAX_FILE_SIZE_DEFAULT=536870912 # 512M
80 82
 fi
81 83
 
82 84
 # if tempest enabled the default size is 6 Gigabyte.
83 85
 if is_service_enabled tempest; then
84 86
     SWIFT_LOOPBACK_DISK_SIZE_DEFAULT=${SWIFT_LOOPBACK_DISK_SIZE:-6G}
87
+    SWIFT_MAX_FILE_SIZE_DEFAULT=5368709122 # Swift default 5G
85 88
 fi
86 89
 
87 90
 SWIFT_LOOPBACK_DISK_SIZE=${SWIFT_LOOPBACK_DISK_SIZE:-$SWIFT_LOOPBACK_DISK_SIZE_DEFAULT}
... ...
@@ -127,6 +130,10 @@ SWIFT_LOG_TOKEN_LENGTH=${SWIFT_LOG_TOKEN_LENGTH:-12}
127 127
 # Swift API
128 128
 SWIFT_MAX_HEADER_SIZE=${SWIFT_MAX_HEADER_SIZE:-16384}
129 129
 
130
+# Set ``SWIFT_MAX_FILE_SIZE`` to configure the maximum file size in Swift API
131
+# Default 500MB because the loopback file used for swift could be 1 or 2 GB
132
+SWIFT_MAX_FILE_SIZE=${SWIFT_MAX_FILE_SIZE:-$SWIFT_MAX_FILE_SIZE_DEFAULT}
133
+
130 134
 # Set ``OBJECT_PORT_BASE``, ``CONTAINER_PORT_BASE``, ``ACCOUNT_PORT_BASE``
131 135
 # Port bases used in port number calculation for the service "nodes"
132 136
 # The specified port number will be used, the additional ports calculated by
... ...
@@ -462,6 +469,7 @@ EOF
462 462
     cp ${SWIFT_DIR}/etc/swift.conf-sample ${SWIFT_CONF_DIR}/swift.conf
463 463
     iniset ${SWIFT_CONF_DIR}/swift.conf swift-hash swift_hash_path_suffix ${SWIFT_HASH}
464 464
     iniset ${SWIFT_CONF_DIR}/swift.conf swift-constraints max_header_size ${SWIFT_MAX_HEADER_SIZE}
465
+    iniset ${SWIFT_CONF_DIR}/swift.conf swift-constraints max_file_size ${SWIFT_MAX_FILE_SIZE}
465 466
 
466 467
     local node_number
467 468
     for node_number in ${SWIFT_REPLICAS_SEQ}; do