From 7021ac5ddba9407d106c582cb97c200d77e1ca65 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 19 Jan 2024 19:26:36 +0900 Subject: [PATCH] storage: support timeout parameters This introduces support for the following these two options for various services. conn_timeout: connection timeout node_timeout: request timeout Change-Id: I318c8db8c564e86b33597d13e0b50da03aa9f16e --- manifests/storage/server.pp | 98 ++++++++++++++++--- .../storage-timeouts-10be849b3eb52217.yaml | 15 +++ spec/defines/swift_storage_server_spec.rb | 21 ++++ 3 files changed, 118 insertions(+), 16 deletions(-) create mode 100644 releasenotes/notes/storage-timeouts-10be849b3eb52217.yaml diff --git a/manifests/storage/server.pp b/manifests/storage/server.pp index 37e10834..13661c8f 100644 --- a/manifests/storage/server.pp +++ b/manifests/storage/server.pp @@ -100,6 +100,14 @@ # See https://docs.openstack.org/swift/latest/deployment_guide.html#general-service-tuning # Defaults to $facts['os_workers']. # +# [*conn_timeout*] +# (optional) Connection timeout to external services. +# Default to $facts['os_service_default']. +# +# [*node_timeout*] +# (optional) Request timeout to external seivices. +# Default to $facts['os_service_default']. +# # [*replicator_concurrency*] # (optional) Number of replicator workers to spawn. # Defaults to 1. @@ -108,6 +116,14 @@ # (optional) Minimum time for a pass to take, in seconds. # Default to $facts['os_service_default']. # +# [*replicator_conn_timeout*] +# (optional) Connection timeout to external services. +# Default to $facts['os_service_default']. +# +# [*replicator_node_timeout*] +# (optional) Request timeout to external seivices. +# Default to $facts['os_service_default']. +# # [*updater_concurrency*] # (optional) Number of updater workers to spawn. # Defaults to 1. @@ -116,6 +132,14 @@ # (optional) Minimum time for a pass to take, in seconds. # Default to $facts['os_service_default']. # +# [*updater_conn_timeout*] +# (optional) Connection timeout to external services. +# Default to $facts['os_service_default']. +# +# [*updater_node_timeout*] +# (optional) Request timeout to external seivices. +# Default to $facts['os_service_default']. +# # [*reaper_concurrency*] # (optional) Number of reaper workers to spawn. # Defaults to 1. @@ -124,6 +148,14 @@ # (optional) Minimum time for a pass to take, in seconds. # Default to $facts['os_service_default']. # +# [*reaper_conn_timeout*] +# (optional) Connection timeout to external services. +# Default to $facts['os_service_default']. +# +# [*reaper_node_timeout*] +# (optional) Request timeout to external seivices. +# Default to $facts['os_service_default']. +# # [*log_facility*] # (optional) Syslog log facility. # Defaults to 'LOG_LOCAL2'. @@ -227,6 +259,14 @@ # (optional) Time in seconds to wait between sharder cycles. # Default to $facts['os_service_default']. # +# [*container_sharder_conn_timeout*] +# (optional) Connection timeout to external services. +# Default to $facts['os_service_default']. +# +# [*container_sharder_node_timeout*] +# (optional) Request timeout to external seivices. +# Default to $facts['os_service_default']. +# # [*purge_config*] # (optional) Whether to set only the specified config options # in the config file. @@ -261,12 +301,20 @@ define swift::storage::server( $servers_per_port = $facts['os_service_default'], $user = undef, $workers = $facts['os_workers'], + $conn_timeout = $facts['os_service_default'], + $node_timeout = $facts['os_service_default'], $replicator_concurrency = 1, $replicator_interval = $facts['os_service_default'], + $replicator_conn_timeout = $facts['os_service_default'], + $replicator_node_timeout = $facts['os_service_default'], $updater_concurrency = 1, $updater_interval = $facts['os_service_default'], + $updater_conn_timeout = $facts['os_service_default'], + $updater_node_timeout = $facts['os_service_default'], $reaper_concurrency = 1, $reaper_interval = $facts['os_service_default'], + $reaper_conn_timeout = $facts['os_service_default'], + $reaper_node_timeout = $facts['os_service_default'], $log_facility = 'LOG_LOCAL2', $log_level = 'INFO', $log_address = '/dev/log', @@ -294,6 +342,8 @@ define swift::storage::server( $container_sharder_auto_shard = $facts['os_service_default'], $container_sharder_concurrency = $facts['os_service_default'], $container_sharder_interval = $facts['os_service_default'], + $container_sharder_conn_timeout = $facts['os_service_default'], + $container_sharder_node_timeout = $facts['os_service_default'], Boolean $purge_config = false, # DEPRECATED PARAMETERS $config_file_path = undef, @@ -386,6 +436,8 @@ define swift::storage::server( '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}, @@ -438,33 +490,43 @@ define swift::storage::server( # account-server # account-auditor # account-replicator - 'account-replicator/concurrency' => {'value' => $replicator_concurrency}, - 'account-replicator/interval' => {'value' => $replicator_interval}, + 'account-replicator/concurrency' => {'value' => $replicator_concurrency}, + 'account-replicator/interval' => {'value' => $replicator_interval}, + 'account-replicator/conn_timeout' => {'value' => $replicator_conn_timeout}, + 'account-replicator/node_timeout' => {'value' => $replicator_node_timeout}, # account-reaper - 'account-reaper/' => {'ensure' => present}, - 'account-reaper/concurrency' => {'value' => $reaper_concurrency}, - 'account-reaper/interval' => {'value' => $reaper_interval}, + 'account-reaper/' => {'ensure' => present}, + 'account-reaper/concurrency' => {'value' => $reaper_concurrency}, + 'account-reaper/interval' => {'value' => $reaper_interval}, + 'account-reaper/conn_timeout' => {'value' => $reaper_conn_timeout}, + 'account-reaper/node_timeout' => {'value' => $reaper_node_timeout}, } } 'container': { $type_opts = { - 'DEFAULT/allowed_sync_hosts' => {'value' => join($::swift::storage::container::allowed_sync_hosts, ',')}, + 'DEFAULT/allowed_sync_hosts' => {'value' => join($::swift::storage::container::allowed_sync_hosts, ',')}, # container-server # container-auditor # container-replicator - 'container-replicator/concurrency' => {'value' => $replicator_concurrency}, - 'container-replicator/interval' => {'value' => $replicator_interval}, + 'container-replicator/concurrency' => {'value' => $replicator_concurrency}, + 'container-replicator/interval' => {'value' => $replicator_interval}, + 'container-replicator/conn_timeout' => {'value' => $replicator_conn_timeout}, + 'container-replicator/node_timeout' => {'value' => $replicator_node_timeout}, # container-updater - 'container-updater/' => {'ensure' => present}, - 'container-updater/concurrency' => {'value' => $updater_concurrency}, - 'container-updater/interval' => {'value' => $updater_interval}, + 'container-updater/' => {'ensure' => present}, + 'container-updater/concurrency' => {'value' => $updater_concurrency}, + 'container-updater/interval' => {'value' => $updater_interval}, + 'container-updater/conn_timeout' => {'value' => $updater_conn_timeout}, + 'container-updater/node_timeout' => {'value' => $updater_node_timeout}, # container-sync - 'container-sync/' => {'ensure' => present}, + 'container-sync/' => {'ensure' => present}, # container-sharder - 'container-sharder/' => {'ensure' => present}, - 'container-sharder/auto_shard' => {'value' => $container_sharder_auto_shard}, - 'container-sharder/concurrency' => {'value' => $container_sharder_concurrency}, - 'container-sharder/interval' => {'value' => $container_sharder_interval}, + 'container-sharder/' => {'ensure' => present}, + 'container-sharder/auto_shard' => {'value' => $container_sharder_auto_shard}, + 'container-sharder/concurrency' => {'value' => $container_sharder_concurrency}, + 'container-sharder/interval' => {'value' => $container_sharder_interval}, + 'container-sharder/conn_timeout' => {'value' => $container_sharder_conn_timeout}, + 'container-sharder/node_timeout' => {'value' => $container_sharder_node_timeout}, } } 'object': { @@ -480,12 +542,16 @@ define swift::storage::server( 'object-auditor/disk_chunk_size' => {'value' => $auditor_disk_chunk_size}, # object-replicator 'object-replicator/concurrency' => {'value' => $replicator_concurrency}, + 'object-replicator/conn_timeout' => {'value' => $replicator_conn_timeout}, + 'object-replicator/node_timeout' => {'value' => $replicator_node_timeout}, 'object-replicator/rsync_timeout' => {'value' => $rsync_timeout}, 'object-replicator/rsync_bwlimit' => {'value' => $rsync_bwlimit}, # object-updater 'object-updater/' => {'ensure' => present}, 'object-updater/concurrency' => {'value' => $updater_concurrency}, 'object-updater/interval' => {'value' => $updater_interval}, + 'object-updater/conn_timeout' => {'value' => $updater_conn_timeout}, + 'object-updater/node_timeout' => {'value' => $updater_node_timeout}, # object-reconstructor 'object-reconstructor/' => {'ensure' => present}, } diff --git a/releasenotes/notes/storage-timeouts-10be849b3eb52217.yaml b/releasenotes/notes/storage-timeouts-10be849b3eb52217.yaml new file mode 100644 index 00000000..271cc299 --- /dev/null +++ b/releasenotes/notes/storage-timeouts-10be849b3eb52217.yaml @@ -0,0 +1,15 @@ +--- +features: + - | + The ``swift::storage::server`` defined resource type now supports + the following parameters. + + - ``conn_timeout`` and ``node_timeout`` for global values + - ``updater_conn_timeout`` and ``updater_node_timeout`` for + container-updater and account-updater + - ``replicator_conn_timeout`` and ``replicator_node_timeout`` for + object-replicator, container-replicator and account-replicator + - ``reaper_node_timeout`` and ``reaper_node_timeout`` for + account-reaper + - ``container_sharder_container_timeout`` and + ``container_sharder_node_timeout`` for container-sharder diff --git a/spec/defines/swift_storage_server_spec.rb b/spec/defines/swift_storage_server_spec.rb index 74b95d35..335e2274 100644 --- a/spec/defines/swift_storage_server_spec.rb +++ b/spec/defines/swift_storage_server_spec.rb @@ -66,6 +66,9 @@ describe 'swift::storage::server' do is_expected.to contain_swift_account_config('DEFAULT/fallocate_reserve').with_value('') is_expected.to contain_swift_account_config('DEFAULT/user').with_value('swift') is_expected.to contain_swift_account_config('DEFAULT/workers').with_value(4) + is_expected.to contain_swift_account_config('DEFAULT/conn_timeout').with_value('') + is_expected.to contain_swift_account_config('DEFAULT/node_timeout').with_value('') + is_expected.to contain_swift_account_config('DEFAULT/disable_fallocate').with_value('') is_expected.to contain_swift_account_config('DEFAULT/log_name').with_value('account-server') is_expected.to contain_swift_account_config('DEFAULT/log_facility').with_value('LOG_LOCAL2') is_expected.to contain_swift_account_config('DEFAULT/log_level').with_value('INFO') @@ -92,9 +95,13 @@ describe 'swift::storage::server' do is_expected.to contain_swift_account_config('account-replicator/rsync_module').with_value('') is_expected.to contain_swift_account_config('account-replicator/concurrency').with_value(1) is_expected.to contain_swift_account_config('account-replicator/interval').with_value('') + is_expected.to contain_swift_account_config('account-replicator/conn_timeout').with_value('') + is_expected.to contain_swift_account_config('account-replicator/node_timeout').with_value('') is_expected.to contain_swift_account_config('account-reaper/').with_ensure('present') is_expected.to contain_swift_account_config('account-reaper/concurrency').with_value(1) is_expected.to contain_swift_account_config('account-reaper/interval').with_value('') + is_expected.to contain_swift_account_config('account-reaper/conn_timeout').with_value('') + is_expected.to contain_swift_account_config('account-reaper/node_timeout').with_value('') } context 'with customized pipeline' do @@ -217,6 +224,8 @@ describe 'swift::storage::server' do is_expected.to contain_swift_container_config('DEFAULT/fallocate_reserve').with_value('') is_expected.to contain_swift_container_config('DEFAULT/user').with_value('swift') is_expected.to contain_swift_container_config('DEFAULT/workers').with_value(4) + is_expected.to contain_swift_container_config('DEFAULT/conn_timeout').with_value('') + is_expected.to contain_swift_container_config('DEFAULT/node_timeout').with_value('') is_expected.to contain_swift_container_config('DEFAULT/log_name').with_value('container-server') is_expected.to contain_swift_container_config('DEFAULT/log_facility').with_value('LOG_LOCAL2') is_expected.to contain_swift_container_config('DEFAULT/log_level').with_value('INFO') @@ -244,13 +253,19 @@ describe 'swift::storage::server' do is_expected.to contain_swift_container_config('container-replicator/rsync_module').with_value('') is_expected.to contain_swift_container_config('container-replicator/concurrency').with_value(1) is_expected.to contain_swift_container_config('container-replicator/interval').with_value('') + is_expected.to contain_swift_container_config('container-replicator/conn_timeout').with_value('') + is_expected.to contain_swift_container_config('container-replicator/node_timeout').with_value('') is_expected.to contain_swift_container_config('container-updater/').with_ensure('present') is_expected.to contain_swift_container_config('container-updater/concurrency').with_value(1) is_expected.to contain_swift_container_config('container-updater/interval').with_value('') + is_expected.to contain_swift_container_config('container-updater/conn_timeout').with_value('') + is_expected.to contain_swift_container_config('container-updater/node_timeout').with_value('') is_expected.to contain_swift_container_config('container-sharder/').with_ensure('present') is_expected.to contain_swift_container_config('container-sharder/auto_shard').with_value('') is_expected.to contain_swift_container_config('container-sharder/concurrency').with_value('') is_expected.to contain_swift_container_config('container-sharder/interval').with_value('') + is_expected.to contain_swift_container_config('container-sharder/conn_timeout').with_value('') + is_expected.to contain_swift_container_config('container-sharder/node_timeout').with_value('') } context 'with customized pipeline' do @@ -373,6 +388,8 @@ describe 'swift::storage::server' do is_expected.to contain_swift_object_config('DEFAULT/fallocate_reserve').with_value('') is_expected.to contain_swift_object_config('DEFAULT/user').with_value('swift') is_expected.to contain_swift_object_config('DEFAULT/workers').with_value(4) + is_expected.to contain_swift_object_config('DEFAULT/conn_timeout').with_value('') + is_expected.to contain_swift_object_config('DEFAULT/node_timeout').with_value('') is_expected.to contain_swift_object_config('DEFAULT/log_name').with_value('object-server') is_expected.to contain_swift_object_config('DEFAULT/log_facility').with_value('LOG_LOCAL2') is_expected.to contain_swift_object_config('DEFAULT/log_level').with_value('INFO') @@ -406,11 +423,15 @@ describe 'swift::storage::server' do is_expected.to contain_swift_object_config('object-replicator/rsync_module').with_value('') is_expected.to contain_swift_object_config('object-replicator/rsync_module').with_value('') is_expected.to contain_swift_object_config('object-replicator/concurrency').with_value(1) + is_expected.to contain_swift_object_config('object-replicator/conn_timeout').with_value('') + is_expected.to contain_swift_object_config('object-replicator/node_timeout').with_value('') is_expected.to contain_swift_object_config('object-replicator/rsync_timeout').with_value('') is_expected.to contain_swift_object_config('object-replicator/rsync_bwlimit').with_value('') is_expected.to contain_swift_object_config('object-updater/').with_ensure('present') is_expected.to contain_swift_object_config('object-updater/concurrency').with_value(1) is_expected.to contain_swift_object_config('object-updater/interval').with_value('') + is_expected.to contain_swift_object_config('object-updater/conn_timeout').with_value('') + is_expected.to contain_swift_object_config('object-updater/node_timeout').with_value('') is_expected.to contain_swift_object_config('object-reconstructor/').with_ensure('present') }