diff --git a/manifests/proxy.pp b/manifests/proxy.pp index 7cd06b75..e97abc9d 100644 --- a/manifests/proxy.pp +++ b/manifests/proxy.pp @@ -132,6 +132,11 @@ # (optional) The headers whose values will only be shown to swift_owners. # Defaults to $facts['os_service_default']. # +# [*stale_worker_timeout*] +# (optional) The grace period (in seconds) after which the reloaded server +# will issue SIGKILLs to remaining stale workers. +# Defaults to $facts['os_service_default']. +# # [*client_timeout*] # (optional) Configures client_timeout for swift proxy-server. # Defaults to $facts['os_service_default']. @@ -236,6 +241,7 @@ class swift::proxy( $write_affinity_node_count = $facts['os_service_default'], $write_affinity_handoff_delete_count = $facts['os_service_default'], $swift_owner_headers = $facts['os_service_default'], + $stale_worker_timeout = $facts['os_service_default'], $client_timeout = $facts['os_service_default'], $keepalive_timeout = $facts['os_service_default'], $node_timeout = $facts['os_service_default'], @@ -320,6 +326,7 @@ class swift::proxy( 'app:proxy-server/timing_expiry': value => $timing_expiry; 'app:proxy-server/request_node_count': value => $request_node_count; 'app:proxy-server/swift_owner_headers': value => join(any2array($swift_owner_headers), ','); + 'app:proxy-server/stale_worker_timeout': value => $stale_worker_timeout; 'app:proxy-server/node_timeout': value => $node_timeout; 'app:proxy-server/recoverable_node_timeout': value => $recoverable_node_timeout; 'app:proxy-server/allow_open_expired': value => $allow_open_expired; diff --git a/manifests/storage/server.pp b/manifests/storage/server.pp index 05e570e4..5dc8d8fd 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']. # +# [*stale_worker_timeout*] +# (optional) The grace period (in seconds) after which the reloaded server +# will issue SIGKILLs to remaining stale workers. +# Defaults to $facts['os_service_default']. +# # [*db_preallocation*] # (optional) Preallocate disk space with SQLite database to decrease # fragmentation. @@ -305,6 +310,7 @@ define swift::storage::server( $disable_fallocate = $facts['os_service_default'], $fallocate_reserve = $facts['os_service_default'], $server_fallocate_reserve = $facts['os_service_default'], + $stale_worker_timeout = $facts['os_service_default'], $db_preallocation = $facts['os_service_default'], $servers_per_port = $facts['os_service_default'], $user = undef, @@ -432,38 +438,39 @@ define swift::storage::server( # common settings $common_opts = { - 'DEFAULT/devices' => {'value' => $devices}, - 'DEFAULT/bind_ip' => {'value' => $storage_local_net_ip}, - 'DEFAULT/bind_port' => {'value' => $bind_port}, - 'DEFAULT/mount_check' => {'value' => $mount_check}, - 'DEFAULT/disable_fallocate' => {'value' => $disable_fallocate}, - 'DEFAULT/fallocate_reserve' => {'value' => $fallocate_reserve}, - 'DEFAULT/user' => {'value' => $user_real}, - 'DEFAULT/workers' => {'value' => $workers}, - 'DEFAULT/conn_timeout' => {'value' => $conn_timeout}, - 'DEFAULT/node_timeout' => {'value' => $node_timeout}, - 'DEFAULT/log_name' => {'value' => $log_name}, - 'DEFAULT/log_facility' => {'value' => $log_facility}, - 'DEFAULT/log_level' => {'value' => $log_level}, - 'DEFAULT/log_address' => {'value' => $log_address}, - 'DEFAULT/log_udp_host' => {'value' => $log_udp_host}, - 'DEFAULT/log_udp_port' => {'value' => $log_udp_port}, - 'DEFAULT/log_max_line_length' => {'value' => $log_max_line_length}, + 'DEFAULT/devices' => {'value' => $devices}, + 'DEFAULT/bind_ip' => {'value' => $storage_local_net_ip}, + 'DEFAULT/bind_port' => {'value' => $bind_port}, + 'DEFAULT/mount_check' => {'value' => $mount_check}, + 'DEFAULT/disable_fallocate' => {'value' => $disable_fallocate}, + 'DEFAULT/fallocate_reserve' => {'value' => $fallocate_reserve}, + 'DEFAULT/user' => {'value' => $user_real}, + 'DEFAULT/workers' => {'value' => $workers}, + 'DEFAULT/conn_timeout' => {'value' => $conn_timeout}, + 'DEFAULT/node_timeout' => {'value' => $node_timeout}, + 'DEFAULT/log_name' => {'value' => $log_name}, + 'DEFAULT/log_facility' => {'value' => $log_facility}, + 'DEFAULT/log_level' => {'value' => $log_level}, + 'DEFAULT/log_address' => {'value' => $log_address}, + 'DEFAULT/log_udp_host' => {'value' => $log_udp_host}, + 'DEFAULT/log_udp_port' => {'value' => $log_udp_port}, + 'DEFAULT/log_max_line_length' => {'value' => $log_max_line_length}, # pipeline - 'pipeline:main/pipeline' => {'value' => join($pipeline, ' ')}, + 'pipeline:main/pipeline' => {'value' => join($pipeline, ' ')}, # server - "app:${type}-server/use" => {'value' => "egg:swift#${type}"}, - "app:${type}-server/set log_name" => {'value' => $log_name}, - "app:${type}-server/set log_facility" => {'value' => $log_facility}, - "app:${type}-server/set log_level" => {'value' => $log_level}, - "app:${type}-server/set log_requests" => {'value' => $log_requests}, - "app:${type}-server/set log_address" => {'value' => $log_address}, - "app:${type}-server/fallocate_reserve" => {'value' => $server_fallocate_reserve}, + "app:${type}-server/use" => {'value' => "egg:swift#${type}"}, + "app:${type}-server/set log_name" => {'value' => $log_name}, + "app:${type}-server/set log_facility" => {'value' => $log_facility}, + "app:${type}-server/set log_level" => {'value' => $log_level}, + "app:${type}-server/set log_requests" => {'value' => $log_requests}, + "app:${type}-server/set log_address" => {'value' => $log_address}, + "app:${type}-server/fallocate_reserve" => {'value' => $server_fallocate_reserve}, + "app:${type}-server/stale_worker_timeout" => {'value' => $stale_worker_timeout}, # auditor - "${type}-auditor/" => {'ensure' => present}, + "${type}-auditor/" => {'ensure' => present}, # replicator - "${type}-replicator/" => {'ensure' => present}, - "${type}-replicator/rsync_module" => {'value' => $rsync_module}, + "${type}-replicator/" => {'ensure' => present}, + "${type}-replicator/rsync_module" => {'value' => $rsync_module}, } Anchor['swift::config::begin'] diff --git a/releasenotes/notes/stale_worker_timeout-36629f8634fde065.yaml b/releasenotes/notes/stale_worker_timeout-36629f8634fde065.yaml new file mode 100644 index 00000000..a9108649 --- /dev/null +++ b/releasenotes/notes/stale_worker_timeout-36629f8634fde065.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + The new ``stale_worker_timeout`` parameter has been added. diff --git a/spec/classes/swift_proxy_spec.rb b/spec/classes/swift_proxy_spec.rb index b084882b..1f230ee7 100644 --- a/spec/classes/swift_proxy_spec.rb +++ b/spec/classes/swift_proxy_spec.rb @@ -91,6 +91,7 @@ describe 'swift::proxy' do it { should contain_swift_proxy_config('app:proxy-server/write_affinity_node_count').with_value('') } it { should contain_swift_proxy_config('app:proxy-server/write_affinity_handoff_delete_count').with_value('') } it { should contain_swift_proxy_config('app:proxy-server/swift_owner_headers').with_value('') } + it { should contain_swift_proxy_config('app:proxy-server/stale_worker_timeout').with_value('') } it { should contain_swift_proxy_config('app:proxy-server/node_timeout').with_value('') } it { should contain_swift_proxy_config('app:proxy-server/recoverable_node_timeout').with_value('') } it { should contain_swift_proxy_config('app:proxy-server/allow_open_expired').with_value('') } @@ -158,6 +159,7 @@ describe 'swift::proxy' do :write_affinity_node_count => '2 * replicas', :write_affinity_handoff_delete_count => 'auto', :swift_owner_headers => ['x-container-read', 'x-container-write'], + :stale_worker_timeout => 86400, :client_timeout => '120', :keepalive_timeout => '121', :node_timeout => '20', @@ -203,6 +205,7 @@ describe 'swift::proxy' do it { should contain_swift_proxy_config('app:proxy-server/write_affinity_node_count').with_value('2 * replicas') } it { should contain_swift_proxy_config('app:proxy-server/write_affinity_handoff_delete_count').with_value('auto') } it { should contain_swift_proxy_config('app:proxy-server/swift_owner_headers').with_value('x-container-read,x-container-write') } + it { should contain_swift_proxy_config('app:proxy-server/stale_worker_timeout').with_value(86400) } it { should contain_swift_proxy_config('app:proxy-server/node_timeout').with_value('20') } it { should contain_swift_proxy_config('app:proxy-server/recoverable_node_timeout').with_value('15') } it { should contain_swift_proxy_config('app:proxy-server/allow_open_expired').with_value(false) } diff --git a/spec/defines/swift_storage_server_spec.rb b/spec/defines/swift_storage_server_spec.rb index 7003eab1..f0f2b8ec 100644 --- a/spec/defines/swift_storage_server_spec.rb +++ b/spec/defines/swift_storage_server_spec.rb @@ -92,6 +92,7 @@ describe 'swift::storage::server' do is_expected.to contain_swift_account_config('app:account-server/set log_requests').with_value(true) is_expected.to contain_swift_account_config('app:account-server/set log_address').with_value('/dev/log') is_expected.to contain_swift_account_config('app:account-server/fallocate_reserve').with_value('') + is_expected.to contain_swift_account_config('app:account-server/stale_worker_timeout').with_value('') is_expected.to contain_swift_account_config('DEFAULT/log_statsd_host').with_value('') is_expected.to contain_swift_account_config('DEFAULT/log_statsd_port').with_value('') @@ -283,6 +284,7 @@ describe 'swift::storage::server' do is_expected.to contain_swift_container_config('app:container-server/set log_requests').with_value(true) is_expected.to contain_swift_container_config('app:container-server/set log_address').with_value('/dev/log') is_expected.to contain_swift_container_config('app:container-server/fallocate_reserve').with_value('') + is_expected.to contain_swift_container_config('app:container-server/stale_worker_timeout').with_value('') is_expected.to contain_swift_container_config('DEFAULT/log_statsd_host').with_value('') is_expected.to contain_swift_container_config('DEFAULT/log_statsd_port').with_value('') @@ -479,6 +481,7 @@ describe 'swift::storage::server' do is_expected.to contain_swift_object_config('app:object-server/set log_requests').with_value(true) is_expected.to contain_swift_object_config('app:object-server/set log_address').with_value('/dev/log') is_expected.to contain_swift_object_config('app:object-server/fallocate_reserve').with_value('') + is_expected.to contain_swift_object_config('app:object-server/stale_worker_timeout').with_value('') is_expected.to contain_swift_object_config('DEFAULT/log_statsd_host').with_value('') is_expected.to contain_swift_object_config('DEFAULT/log_statsd_port').with_value('')