From 04e9a3657ad8a6dd682580f4787278c2ccbe9992 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 5 Mar 2024 13:38:27 +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: Iefecbae22a80e5218b43067536378beff72badbb --- manifests/cache.pp | 22 +++++++++++++++++++ ...client_retry_options-0da38fb3976ce77b.yaml | 6 +++++ spec/classes/zaqar_cache_spec.rb | 9 ++++++++ 3 files changed, 37 insertions(+) create mode 100644 releasenotes/notes/add_cache_hashclient_retry_options-0da38fb3976ce77b.yaml diff --git a/manifests/cache.pp b/manifests/cache.pp index e30cac1..13c9ebb 100644 --- a/manifests/cache.pp +++ b/manifests/cache.pp @@ -160,6 +160,22 @@ # (Optional) Number of seconds to sleep between each attempt. # Default to $facts['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 $facts['os_service_default'] +# +# [*hashclient_retry_delay*] +# (Optional) Time in seconds that should pass between +# retry attempts in the HashClient's internal mechanisms. +# Default to $facts['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 $facts['os_service_default'] +# class zaqar::cache ( $config_prefix = $facts['os_service_default'], $expiration_time = $facts['os_service_default'], @@ -188,6 +204,9 @@ class zaqar::cache ( $enable_retry_client = $facts['os_service_default'], $retry_attempts = $facts['os_service_default'], $retry_delay = $facts['os_service_default'], + $hashclient_retry_attempts = $facts['os_service_default'], + $hashclient_retry_delay = $facts['os_service_default'], + $dead_timeout = $facts['os_service_default'], ) { include zaqar::deps @@ -220,5 +239,8 @@ class zaqar::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, } } diff --git a/releasenotes/notes/add_cache_hashclient_retry_options-0da38fb3976ce77b.yaml b/releasenotes/notes/add_cache_hashclient_retry_options-0da38fb3976ce77b.yaml new file mode 100644 index 0000000..35e1c47 --- /dev/null +++ b/releasenotes/notes/add_cache_hashclient_retry_options-0da38fb3976ce77b.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Add options to configure pymemcache's HashClient retrying mechanisms + (dogpile.cache) backend. + diff --git a/spec/classes/zaqar_cache_spec.rb b/spec/classes/zaqar_cache_spec.rb index 10846b5..1bd83d1 100644 --- a/spec/classes/zaqar_cache_spec.rb +++ b/spec/classes/zaqar_cache_spec.rb @@ -37,6 +37,9 @@ describe 'zaqar::cache' do :enable_retry_client => '', :retry_attempts => '', :retry_delay => '', + :hashclient_retry_attempts => '', + :hashclient_retry_delay => '', + :dead_timeout => '', :manage_backend_package => true, ) end @@ -66,6 +69,9 @@ describe 'zaqar::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, } end @@ -98,6 +104,9 @@ describe 'zaqar::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, ) end