diff --git a/manifests/cache.pp b/manifests/cache.pp index 63c3017..d5c43cd 100644 --- a/manifests/cache.pp +++ b/manifests/cache.pp @@ -183,6 +183,22 @@ # (Optional) Number of seconds to sleep between each attempt. # Default to $::os_service_default # +# [*hashclient_retry_attempts*] +# (Optional) Amount of times a client should be tried +# before it is marked dead and removed from the pool in +# the HashClient's internal mechanisms. +# Default to $::os_service_default +# +# [*hashclient_retry_delay*] +# (Optional) Time in seconds that should pass between +# retry attempts in the HashClient's internal mechanisms. +# Default to $::os_service_default +# +# [*dead_timeout*] +# (Optional) Time in seconds before attempting to add a node +# back in the pool in the HashClient's internal mechanisms. +# Default to $::os_service_default +# # [*manage_backend_package*] # (Optional) Whether to install the backend package. # Defaults to true. @@ -217,6 +233,9 @@ define oslo::cache( $enable_retry_client = $::os_service_default, $retry_attempts = $::os_service_default, $retry_delay = $::os_service_default, + $hashclient_retry_attempts = $::os_service_default, + $hashclient_retry_delay = $::os_service_default, + $dead_timeout = $::os_service_default, $manage_backend_package = true, $package_ensure = 'present', ){ @@ -281,6 +300,9 @@ define oslo::cache( 'cache/enable_retry_client' => { value => $enable_retry_client }, 'cache/retry_attempts' => { value => $retry_attempts }, 'cache/retry_delay' => { value => $retry_delay }, + 'cache/hashclient_retry_attempts' => { value => $hashclient_retry_attempts }, + 'cache/hashclient_retry_delay' => { value => $hashclient_retry_delay }, + 'cache/dead_timeout' => { value => $dead_timeout }, } create_resources($name, $cache_options) diff --git a/releasenotes/notes/pymemcache_hashclient_retrying-10a756708ad9894b.yaml b/releasenotes/notes/pymemcache_hashclient_retrying-10a756708ad9894b.yaml new file mode 100644 index 0000000..116e436 --- /dev/null +++ b/releasenotes/notes/pymemcache_hashclient_retrying-10a756708ad9894b.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Add options to configure pymemcache's HashClient retrying mechanisms + (dogpile.cache) backend. diff --git a/spec/defines/oslo_cache_spec.rb b/spec/defines/oslo_cache_spec.rb index 282407d..e015f48 100644 --- a/spec/defines/oslo_cache_spec.rb +++ b/spec/defines/oslo_cache_spec.rb @@ -33,6 +33,9 @@ describe 'oslo::cache' do is_expected.to contain_keystone_config('cache/enable_retry_client').with_value('') is_expected.to contain_keystone_config('cache/retry_attempts').with_value('') is_expected.to contain_keystone_config('cache/retry_delay').with_value('') + is_expected.to contain_keystone_config('cache/hashclient_retry_attempts').with_value('') + is_expected.to contain_keystone_config('cache/hashclient_retry_delay').with_value('') + is_expected.to contain_keystone_config('cache/dead_timeout').with_value('') end end @@ -64,6 +67,9 @@ describe 'oslo::cache' do :enable_retry_client => false, :retry_attempts => 2, :retry_delay => 0, + :hashclient_retry_attempts => 2, + :hashclient_retry_delay => 1, + :dead_timeout => 60, } end @@ -93,6 +99,9 @@ describe 'oslo::cache' do is_expected.to contain_keystone_config('cache/enable_retry_client').with_value('false') is_expected.to contain_keystone_config('cache/retry_attempts').with_value('2') is_expected.to contain_keystone_config('cache/retry_delay').with_value('0') + is_expected.to contain_keystone_config('cache/hashclient_retry_attempts').with_value('2') + is_expected.to contain_keystone_config('cache/hashclient_retry_delay').with_value('1') + is_expected.to contain_keystone_config('cache/dead_timeout').with_value('60') end end