Add config option for fallocate_reserve

In order to prevent disks from filling up, add the option to configure
fallocate_reserve parameter in account-server.conf,
container-server.conf, and object-server.conf, as described in
https://docs.openstack.org/swift/latest/admin_guide.html#preventing-disk-full-scenarios

This change adds the config option file-allocation-reserve with a
default of 0.

Change-Id: Ib396a151250bb8d1733f9b5b9cab7eb506c9f6c6
Closes-Bug: 1872069
This commit is contained in:
Drew Freiberger 2020-05-11 15:18:32 -05:00 committed by Andrea Ieri
parent 971df56d61
commit d31095d482
6 changed files with 19 additions and 0 deletions

View File

@ -126,6 +126,13 @@ options:
type: int
description: |
Timeout value used when copying account/container/object data between nodes.
file-allocation-reserve:
default: 0
type: int
description: |
Set the reserve space for the swift filesystem mounts.
If a disk has less than this amount of space (in bytes) free, writes
will be handed off to another disk in the ring.
nagios-check-params:
default: "-m -r 60 180 10 20"
type: string

View File

@ -102,6 +102,7 @@ class SwiftStorageServerContext(OSContextGenerator):
'object-replicator-concurrency'),
'object_rsync_timeout': config('object-rsync-timeout'),
'object_handoffs_first': config('object-handoffs-first'),
'fallocate_reserve': config('file-allocation-reserve'),
'statsd_host': config('statsd-host'),
'statsd_port': config('statsd-port'),
'statsd_sample_rate': config('statsd-sample-rate'),

View File

@ -5,6 +5,9 @@ workers = {{ workers }}
{% if node_timeout -%}
node_timeout = {{ node_timeout }}
{%- endif %}
{% if fallocate_reserve != 0 %}
fallocate_reserve = {{ fallocate_reserve }}
{% endif %}
{% if statsd_host %}
log_statsd_host = {{ statsd_host }}

View File

@ -5,6 +5,9 @@ workers = {{ workers }}
{% if node_timeout -%}
node_timeout = {{ node_timeout }}
{%- endif %}
{% if fallocate_reserve != 0 %}
fallocate_reserve = {{ fallocate_reserve }}
{% endif %}
{% if statsd_host %}
log_statsd_host = {{ statsd_host }}

View File

@ -5,6 +5,9 @@ workers = {{ workers }}
{% if node_timeout -%}
node_timeout = {{ node_timeout }}
{%- endif %}
{% if fallocate_reserve != 0 %}
fallocate_reserve = {{ fallocate_reserve }}
{% endif %}
{% if statsd_host %}
log_statsd_host = {{ statsd_host }}

View File

@ -96,6 +96,7 @@ class SwiftStorageContextTests(CharmTestCase):
self.test_config.set('object-max-connections', '10')
self.test_config.set('object-rsync-timeout', '950')
self.test_config.set('object-handoffs-first', True)
self.test_config.set('file-allocation-reserve', '10737418240')
ctxt = swift_context.SwiftStorageServerContext()
result = ctxt()
ex = {
@ -112,6 +113,7 @@ class SwiftStorageContextTests(CharmTestCase):
'container_max_connections': '10',
'object_max_connections': '10',
'object_rsync_timeout': '950',
'fallocate_reserve': '10737418240',
'standalone_replicator': True,
'object_handoffs_first': True,
'statsd_host': '',