From 81aecda55fd612ff095f1546521b48dd0216ffbd Mon Sep 17 00:00:00 2001 From: Andy McCrae Date: Fri, 12 Feb 2016 15:04:49 +0000 Subject: [PATCH] Expose and set a default fallocate_reserve value When swift disks fill up completely it becomes difficult to perform operations since delete operations require a write. By setting this value we can ensure that PUT requests won't happen when the disk space is below the threshold set (in bytes). This will not govern rsyncs, which can still happen to fill up the disks, but assuming a reasonably uniform distribution of data this should help prevent disks from filling up. Change-Id: I753de5e5ed09a21571575ef51c38752edc0730cb Closes-Bug: #1545018 --- defaults/main.yml | 10 ++++++++++ .../swift-fallocate-reserve-ff513025da68bfed.yaml | 8 ++++++++ templates/account-server.conf.j2 | 3 +++ templates/container-server.conf.j2 | 3 +++ templates/object-server.conf.j2 | 3 +++ 5 files changed, 27 insertions(+) create mode 100644 releasenotes/notes/swift-fallocate-reserve-ff513025da68bfed.yaml diff --git a/defaults/main.yml b/defaults/main.yml index 5cb8d45c..c3d43679 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -135,6 +135,16 @@ swift_allow_all_users: False # If you want to regenerate the swift keys, on a run, for rsync purposes set this var to True otherwise keys will be generated on the first run and not regenerated each run. swift_recreate_keys: False swift_sorting_method: shuffle +# Set the fallocate_reserve value which will reserve space and fail on PUTs above this value in bytes (Default 10GB) +swift_fallocate_reserve: 10737418240 +swift_account_fallocate_reserve: "{{ swift_fallocate_reserve }}" +swift_container_fallocate_reserve: "{{ swift_fallocate_reserve }}" +swift_object_fallocate_reserve: "{{ swift_fallocate_reserve }}" +# Set this to true to disable fallocate +swift_disable_fallocate: false +swift_account_disable_fallocate: "{{ swift_disable_fallocate }}" +swift_container_disable_fallocate: "{{ swift_disable_fallocate }}" +swift_object_disable_fallocate: "{{ swift_disable_fallocate }}" ## Swift ceilometer variables swift_reselleradmin_role: ResellerAdmin diff --git a/releasenotes/notes/swift-fallocate-reserve-ff513025da68bfed.yaml b/releasenotes/notes/swift-fallocate-reserve-ff513025da68bfed.yaml new file mode 100644 index 00000000..eda9e921 --- /dev/null +++ b/releasenotes/notes/swift-fallocate-reserve-ff513025da68bfed.yaml @@ -0,0 +1,8 @@ +--- +features: + - Allow the fallocate_reserve option to be set (in + bytes) for Swift, to help prevent disks from filling + up and prevent a situation where Swift is unable to + remove objects due to a lack of disk space. The + fallocate_reserve value to is set to a default of + 10GB. diff --git a/templates/account-server.conf.j2 b/templates/account-server.conf.j2 index 411bf6cc..dc47ba45 100644 --- a/templates/account-server.conf.j2 +++ b/templates/account-server.conf.j2 @@ -13,6 +13,9 @@ devices = {{ swift_vars.mount_point | default(swift.mount_point) }} log_facility = LOG_LOCAL2 {% include "statsd.j2" %} +disable_fallocate = {{ swift_account_disable_fallocate }} +fallocate_reserve = {{ swift_account_fallocate_reserve }} + [pipeline:main] pipeline = healthcheck recon account-server diff --git a/templates/container-server.conf.j2 b/templates/container-server.conf.j2 index 3445b6f9..b4a779cc 100644 --- a/templates/container-server.conf.j2 +++ b/templates/container-server.conf.j2 @@ -13,6 +13,9 @@ devices = {{ swift_vars.mount_point | default(swift.mount_point) }} log_facility = LOG_LOCAL3 {% include "statsd.j2" %} +disable_fallocate = {{ swift_container_disable_fallocate }} +fallocate_reserve = {{ swift_container_fallocate_reserve }} + [pipeline:main] pipeline = healthcheck recon container-server diff --git a/templates/object-server.conf.j2 b/templates/object-server.conf.j2 index 15ee74bb..6a29cb90 100644 --- a/templates/object-server.conf.j2 +++ b/templates/object-server.conf.j2 @@ -14,6 +14,9 @@ devices = {{ swift_vars.mount_point | default(swift.mount_point) }} log_facility = LOG_LOCAL4 {% include "statsd.j2" %} +disable_fallocate = {{ swift_object_disable_fallocate }} +fallocate_reserve = {{ swift_object_fallocate_reserve }} + [pipeline:main] pipeline = healthcheck recon object-server