Skip to content

Commit

Permalink
storage: Add support for db_preallocation
Browse files Browse the repository at this point in the history
Change-Id: I6f9f46b2c00e29d108d9f943b54e2205844ef973
  • Loading branch information
kajinamit committed Aug 14, 2024
1 parent ebc1224 commit 5b6630e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions manifests/storage/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
# all times. This option affects only <type>-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
Expand Down Expand Up @@ -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'],
Expand Down Expand Up @@ -480,6 +486,7 @@
case $type {
'account': {
$type_opts = {
'DEFAULT/db_preallocation' => {'value' => $db_preallocation},
# account-server
# account-auditor
# account-replicator
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions releasenotes/notes/db_preallocation-4226028636c46c4d.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
features:
- |
The new ``swift::storage::server::db_preallocation`` parameter has been
added.
2 changes: 2 additions & 0 deletions spec/defines/swift_storage_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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('<SERVICE DEFAULT>')
is_expected.to contain_swift_account_config('DEFAULT/log_statsd_metric_prefix').with_value('<SERVICE DEFAULT>')

is_expected.to contain_swift_account_config('DEFAULT/db_preallocation').with_value('<SERVICE DEFAULT>')
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')
Expand Down Expand Up @@ -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('<SERVICE DEFAULT>')
is_expected.to contain_swift_container_config('DEFAULT/log_statsd_metric_prefix').with_value('<SERVICE DEFAULT>')

is_expected.to contain_swift_container_config('DEFAULT/db_preallocation').with_value('<SERVICE DEFAULT>')
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')
Expand Down

0 comments on commit 5b6630e

Please sign in to comment.