From 7d46d12b4103355a2bcb69395486631004ffe826 Mon Sep 17 00:00:00 2001 From: David Hill Date: Thu, 31 Oct 2019 16:50:18 -0400 Subject: [PATCH] Allow users to change container-replicator interval value. The default interval value is 30s and in some case, this is way too agressive and we need an automated way of tweaking this value. Change-Id: I271c218b45d10f15544077e93ded9d74d7842f65 Closes-bug: #1850856 --- manifests/storage/server.pp | 5 +++++ spec/defines/swift_storage_server_spec.rb | 10 ++++++++++ templates/account-server.conf.erb | 1 + templates/container-server.conf.erb | 1 + 4 files changed, 17 insertions(+) diff --git a/manifests/storage/server.pp b/manifests/storage/server.pp index 68296727..6b731183 100644 --- a/manifests/storage/server.pp +++ b/manifests/storage/server.pp @@ -76,6 +76,10 @@ # (optional) Number of replicator workers to spawn. # Defaults to 1. # +# [*replicator_interval*] +# (optional) Minimum time for a pass to take, in seconds. +# Defaults to 30. +# # [*updater_concurrency*] # (optional) Number of updater workers to spawn. # Defaults to 1. @@ -164,6 +168,7 @@ define swift::storage::server( $workers = $::os_workers, $allow_versions = false, $replicator_concurrency = 1, + $replicator_interval = 30, $updater_concurrency = 1, $reaper_concurrency = 1, $log_facility = 'LOG_LOCAL2', diff --git a/spec/defines/swift_storage_server_spec.rb b/spec/defines/swift_storage_server_spec.rb index 2018ef24..81209fcf 100644 --- a/spec/defines/swift_storage_server_spec.rb +++ b/spec/defines/swift_storage_server_spec.rb @@ -92,6 +92,16 @@ describe 'swift::storage::server' do it { is_expected.to contain_concat_fragment("swift-#{t}-#{title}").with_content(/\[#{t}-replicator\]\nconcurrency\s*=\s*42\s*$/m) } end + if t != 'object' + describe "when replicator_concurrency and replicator_interval are set" do + let :params do req_params.merge( + { :replicator_concurrency => 42, + :replicator_interval => 42}) + end + it { is_expected.to contain_concat_fragment("swift-#{t}-#{title}").with_content(/\[#{t}-replicator\]\nconcurrency\s*=\s*42\ninterval\s*=\s*42\s*$/m) } + end + end + if t != 'account' describe "when updater_concurrency is set" do let :params do req_params.merge({:updater_concurrency => 73}) end diff --git a/templates/account-server.conf.erb b/templates/account-server.conf.erb index d551d14f..d4fa2a78 100644 --- a/templates/account-server.conf.erb +++ b/templates/account-server.conf.erb @@ -37,6 +37,7 @@ set log_address = <%= @log_address %> [account-replicator] concurrency = <%= @replicator_concurrency %> +interval = <%= @replicator_interval %> [account-auditor] diff --git a/templates/container-server.conf.erb b/templates/container-server.conf.erb index 75646003..3a67a602 100644 --- a/templates/container-server.conf.erb +++ b/templates/container-server.conf.erb @@ -39,6 +39,7 @@ set log_address = <%= @log_address %> [container-replicator] concurrency = <%= @replicator_concurrency %> +interval = <%= @replicator_interval %> [container-updater] concurrency = <%= @updater_concurrency %>