From 6830a2af6df96c00cb7fe5f6c345ea69bffef04b Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 16 Feb 2022 11:31:30 +0900 Subject: [PATCH] Add HashClient retry options for the dogpile.cache backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch specifies a set of options required to setup the HashClient retry feature of dogpile.cache cache backend. Original oslo.cache change: https://review.opendev.org/c/openstack/oslo.cache/+/824944 Co-Authored-By: Hervé Beraud Depends-On: https://review.opendev.org/826870 Change-Id: Ibe064defd7fca3f88206943ae2835daa4a96ea35 --- manifests/cache.pp | 22 +++++++++++++++++++ ...client_retry_options-891527bba8cbbb16.yaml | 5 +++++ spec/classes/heat_cache_spec.rb | 9 ++++++++ 3 files changed, 36 insertions(+) create mode 100644 releasenotes/notes/add_cache_hashclient_retry_options-891527bba8cbbb16.yaml diff --git a/manifests/cache.pp b/manifests/cache.pp index f04d9d5d..9941dd1f 100644 --- a/manifests/cache.pp +++ b/manifests/cache.pp @@ -182,6 +182,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 +# class heat::cache ( $config_prefix = $::os_service_default, $expiration_time = $::os_service_default, @@ -215,6 +231,9 @@ class heat::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, ) { include heat::deps @@ -246,6 +265,9 @@ class heat::cache ( enable_retry_client => $enable_retry_client, retry_attempts => $retry_attempts, retry_delay => $retry_delay, + hashclient_retry_attempts => $hashclient_retry_attempts, + hashclient_retry_delay => $hashclient_retry_delay, + dead_timeout => $dead_timeout, } heat_config { diff --git a/releasenotes/notes/add_cache_hashclient_retry_options-891527bba8cbbb16.yaml b/releasenotes/notes/add_cache_hashclient_retry_options-891527bba8cbbb16.yaml new file mode 100644 index 00000000..116e436e --- /dev/null +++ b/releasenotes/notes/add_cache_hashclient_retry_options-891527bba8cbbb16.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Add options to configure pymemcache's HashClient retrying mechanisms + (dogpile.cache) backend. diff --git a/spec/classes/heat_cache_spec.rb b/spec/classes/heat_cache_spec.rb index 81be2bea..6d8c4c90 100644 --- a/spec/classes/heat_cache_spec.rb +++ b/spec/classes/heat_cache_spec.rb @@ -36,6 +36,9 @@ describe 'heat::cache' do :enable_retry_client => '', :retry_attempts => '', :retry_delay => '', + :hashclient_retry_attempts => '', + :hashclient_retry_delay => '', + :dead_timeout => '', :manage_backend_package => true, ) is_expected.to contain_heat_config('constraint_validation_cache/caching').with_value('') @@ -70,6 +73,9 @@ describe 'heat::cache' do :enable_retry_client => false, :retry_attempts => 2, :retry_delay => 0, + :hashclient_retry_attempts => 2, + :hashclient_retry_delay => 1, + :dead_timeout => 60, :manage_backend_package => false, :constraint_validation_caching => true, :constraint_validation_expiration_time => '3600', @@ -107,6 +113,9 @@ describe 'heat::cache' do :enable_retry_client => false, :retry_attempts => 2, :retry_delay => 0, + :hashclient_retry_attempts => 2, + :hashclient_retry_delay => 1, + :dead_timeout => 60, :manage_backend_package => false, ) is_expected.to contain_heat_config('constraint_validation_cache/caching').with_value('true')