From dc390cde25d9090b4fa2c1c1309c610159abeb0e Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 29 Jun 2025 00:11:59 +0900 Subject: [PATCH] object-expirer: Support more tunables Change-Id: Ib348ab61117e4730fd2eb7d0dbb02a379de5afdd --- manifests/objectexpirer.pp | 13 ++++++++++++ ...ect-expirer-tunables-7d884f2ea496f44b.yaml | 7 +++++++ spec/classes/swift_objectexpirer_spec.rb | 20 ++++++++++++++----- 3 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/object-expirer-tunables-7d884f2ea496f44b.yaml diff --git a/manifests/objectexpirer.pp b/manifests/objectexpirer.pp index 7d2abfbb..060a6943 100644 --- a/manifests/objectexpirer.pp +++ b/manifests/objectexpirer.pp @@ -40,6 +40,15 @@ # reclaimed. # Defaults to $facts['os_service_default']. # +# [*request_tries*] +# (optional) Server errors from requests will be retried by default +# Defaults to $facts['os_service_default'] +# +# [*tasks_per_second*] +# (optional) Deletes can be ratelimited to prevent the expirer from +# overwhelming the cluster +# Defaults to $facts['os_service_default'] +# # [*recon_cache_path*] # (optional) Directory where stats for a few items will be stored. # Defaults to $facts['os_service_default']. @@ -130,6 +139,8 @@ class swift::objectexpirer( $process = $facts['os_service_default'], $processes = $facts['os_service_default'], $reclaim_age = $facts['os_service_default'], + $request_tries = $facts['os_service_default'], + $tasks_per_second = $facts['os_service_default'], $recon_cache_path = $facts['os_service_default'], $report_interval = $facts['os_service_default'], Swift::ServiceProvider $service_provider = $::swift::params::service_provider, @@ -223,6 +234,8 @@ class swift::objectexpirer( 'object-expirer/process': value => $process; 'object-expirer/processes': value => $processes; 'object-expirer/reclaim_age': value => $reclaim_age; + 'object-expirer/request_tries': value => $request_tries; + 'object-expirer/tasks_per_second': value => $tasks_per_second; 'object-expirer/recon_cache_path': value => $recon_cache_path; 'object-expirer/report_interval': value => $report_interval; 'object-expirer/log_name': value => $log_name; diff --git a/releasenotes/notes/object-expirer-tunables-7d884f2ea496f44b.yaml b/releasenotes/notes/object-expirer-tunables-7d884f2ea496f44b.yaml new file mode 100644 index 00000000..295baad6 --- /dev/null +++ b/releasenotes/notes/object-expirer-tunables-7d884f2ea496f44b.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + The ``swift::objectexpirer`` class now supports the following parameters. + + - ``request_tries`` + - ``tasks_per_second`` diff --git a/spec/classes/swift_objectexpirer_spec.rb b/spec/classes/swift_objectexpirer_spec.rb index 035891ba..45bf71b5 100644 --- a/spec/classes/swift_objectexpirer_spec.rb +++ b/spec/classes/swift_objectexpirer_spec.rb @@ -34,6 +34,10 @@ describe 'swift::objectexpirer' do 'object-expirer/processes').with_value('') is_expected.to contain_swift_object_expirer_config( 'object-expirer/reclaim_age').with_value('') + is_expected.to contain_swift_object_expirer_config( + 'object-expirer/request_tries').with_value('') + is_expected.to contain_swift_object_expirer_config( + 'object-expirer/tasks_per_second').with_value('') is_expected.to contain_swift_object_expirer_config( 'object-expirer/recon_cache_path').with_value('') is_expected.to contain_swift_object_expirer_config( @@ -73,18 +77,24 @@ describe 'swift::objectexpirer' do context 'when overriding parameters' do before do params.merge!( - :interval => '600', - :reclaim_age => '10000', - :concurrency => '3', + :concurrency => 4, + :interval => 600, + :reclaim_age => 86400, + :request_tries => 3, + :tasks_per_second => 50, ) end it 'configures object-expirer.conf' do is_expected.to contain_swift_object_expirer_config( - 'object-expirer/concurrency').with_value('3') + 'object-expirer/concurrency').with_value(4) is_expected.to contain_swift_object_expirer_config( 'object-expirer/interval').with_value('600') is_expected.to contain_swift_object_expirer_config( - 'object-expirer/reclaim_age').with_value('10000') + 'object-expirer/reclaim_age').with_value(86400) + is_expected.to contain_swift_object_expirer_config( + 'object-expirer/request_tries').with_value(3) + is_expected.to contain_swift_object_expirer_config( + 'object-expirer/tasks_per_second').with_value(50) end end