From 5b6630e97b11af319ae364c51693147180f6f203 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 14 Aug 2024 18:44:29 +0900 Subject: [PATCH] storage: Add support for db_preallocation Change-Id: I6f9f46b2c00e29d108d9f943b54e2205844ef973 --- manifests/storage/server.pp | 8 ++++++++ releasenotes/notes/db_preallocation-4226028636c46c4d.yaml | 5 +++++ spec/defines/swift_storage_server_spec.rb | 2 ++ 3 files changed, 15 insertions(+) create mode 100644 releasenotes/notes/db_preallocation-4226028636c46c4d.yaml diff --git a/manifests/storage/server.pp b/manifests/storage/server.pp index c5bc7275..6490e1ba 100644 --- a/manifests/storage/server.pp +++ b/manifests/storage/server.pp @@ -79,6 +79,11 @@ # all times. This option affects only -server processes. # Defaults to $facts['os_service_default']. # +# [*db_preallocation*] +# (optional) Preallocate disk space with SQLite database to decrease +# fragmentation. +# Defaults to $facts['os_service_default']. +# # [*servers_per_port*] # (optional) Spawn multiple servers per device on different ports. # Make object-server run this many worker processes per unique port of @@ -296,6 +301,7 @@ $disable_fallocate = $facts['os_service_default'], $fallocate_reserve = $facts['os_service_default'], $server_fallocate_reserve = $facts['os_service_default'], + $db_preallocation = $facts['os_service_default'], $servers_per_port = $facts['os_service_default'], $user = undef, $workers = $facts['os_workers'], @@ -480,6 +486,7 @@ case $type { 'account': { $type_opts = { + 'DEFAULT/db_preallocation' => {'value' => $db_preallocation}, # account-server # account-auditor # account-replicator @@ -511,6 +518,7 @@ } 'container': { $type_opts = { + 'DEFAULT/db_preallocation' => {'value' => $db_preallocation}, 'DEFAULT/allowed_sync_hosts' => {'value' => join($::swift::storage::container::allowed_sync_hosts, ',')}, # container-server # container-auditor diff --git a/releasenotes/notes/db_preallocation-4226028636c46c4d.yaml b/releasenotes/notes/db_preallocation-4226028636c46c4d.yaml new file mode 100644 index 00000000..8fa50f0f --- /dev/null +++ b/releasenotes/notes/db_preallocation-4226028636c46c4d.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``swift::storage::server::db_preallocation`` parameter has been + added. diff --git a/spec/defines/swift_storage_server_spec.rb b/spec/defines/swift_storage_server_spec.rb index a63ba386..9a625f6c 100644 --- a/spec/defines/swift_storage_server_spec.rb +++ b/spec/defines/swift_storage_server_spec.rb @@ -98,6 +98,7 @@ class { 'swift::storage': storage_local_net_ip => '10.0.0.1' } is_expected.to contain_swift_account_config('DEFAULT/log_statsd_sample_rate_factor').with_value('') is_expected.to contain_swift_account_config('DEFAULT/log_statsd_metric_prefix').with_value('') + is_expected.to contain_swift_account_config('DEFAULT/db_preallocation').with_value('') is_expected.to contain_swift_account_config('account-auditor/').with_ensure('present') is_expected.to contain_swift_account_config('account-auditor/log_name').with_ensure('absent') is_expected.to contain_swift_account_config('account-replicator/').with_ensure('present') @@ -287,6 +288,7 @@ class { 'swift::storage': storage_local_net_ip => '10.0.0.1' } is_expected.to contain_swift_container_config('DEFAULT/log_statsd_sample_rate_factor').with_value('') is_expected.to contain_swift_container_config('DEFAULT/log_statsd_metric_prefix').with_value('') + is_expected.to contain_swift_container_config('DEFAULT/db_preallocation').with_value('') is_expected.to contain_swift_container_config('DEFAULT/allowed_sync_hosts').with_value('127.0.0.1') is_expected.to contain_swift_container_config('container-auditor/').with_ensure('present') is_expected.to contain_swift_container_config('container-auditor/log_name').with_ensure('absent')