From 90d18391d3f6eda0411f9e5547c725de3f529e6d Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 23 Nov 2025 01:29:21 +0900 Subject: [PATCH] cache: Follow renaming of hashclient parameters Depends-on: https://review.opendev.org/967580 Depends-on: https://review.opendev.org/967710 Change-Id: I2d81effea45194a3ffbc27c3f23405ffb8a4e2dd Signed-off-by: Takashi Kajinami --- manifests/cache.pp | 30 +++++++++++++++---- ...me-hashclient-params-2af8313821fe97e2.yaml | 8 +++++ spec/classes/trove_cache_spec.rb | 18 +++++++---- 3 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 releasenotes/notes/cache-rename-hashclient-params-2af8313821fe97e2.yaml diff --git a/manifests/cache.pp b/manifests/cache.pp index c0b4541f..542efc6d 100644 --- a/manifests/cache.pp +++ b/manifests/cache.pp @@ -203,12 +203,12 @@ # the HashClient's internal mechanisms. # Default to $facts['os_service_default'] # -# [*hashclient_retry_delay*] +# [*hashclient_retry_timeout*] # (Optional) Time in seconds that should pass between # retry attempts in the HashClient's internal mechanisms. # Default to $facts['os_service_default'] # -# [*dead_timeout*] +# [*hashclient_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'] @@ -217,6 +217,18 @@ # (Optional) Whether to install the backend package for the cache. # Defaults to true # +# DEPRECATED PARAMETERS +# +# [*hashclient_retry_delay*] +# (Optional) Time in seconds that should pass between +# retry attempts in the HashClient's internal mechanisms. +# Default to undef +# +# [*dead_timeout*] +# (Optional) Time in seconds before attempting to add a node +# back in the pool in the HashClient's internal mechanisms. +# Default to undef +# class trove::cache ( $config_prefix = $facts['os_service_default'], $expiration_time = $facts['os_service_default'], @@ -255,9 +267,11 @@ class trove::cache ( $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'], + $hashclient_retry_timeout = $facts['os_service_default'], + $hashclient_dead_timeout = $facts['os_service_default'], Boolean $manage_backend_package = true, + $hashclient_retry_delay = undef, + $dead_timeout = undef, ) { include trove::deps @@ -299,8 +313,14 @@ class trove::cache ( retry_attempts => $retry_attempts, retry_delay => $retry_delay, hashclient_retry_attempts => $hashclient_retry_attempts, + hashclient_retry_timeout => $hashclient_retry_timeout, + hashclient_dead_timeout => $hashclient_dead_timeout, + manage_backend_package => $manage_backend_package, hashclient_retry_delay => $hashclient_retry_delay, dead_timeout => $dead_timeout, - manage_backend_package => $manage_backend_package, } + + # all cache settings should be applied and all packages should be installed + # before service startup + Oslo::Cache['trove_config'] -> Anchor['trove::service::begin'] } diff --git a/releasenotes/notes/cache-rename-hashclient-params-2af8313821fe97e2.yaml b/releasenotes/notes/cache-rename-hashclient-params-2af8313821fe97e2.yaml new file mode 100644 index 00000000..50252edf --- /dev/null +++ b/releasenotes/notes/cache-rename-hashclient-params-2af8313821fe97e2.yaml @@ -0,0 +1,8 @@ +--- +deprecations: + - | + The ``trove::cache::hashclient_retry_delay`` parameter was deprecated + in favor of the new ``hashclient_retry_timeout`` parameter. + - | + The ``trove::cache::dead_timeout`` parameter was deprecated in favor + of the new ``hashclient_dead_timeout`` parameter. diff --git a/spec/classes/trove_cache_spec.rb b/spec/classes/trove_cache_spec.rb index 090ec331..47585ce3 100644 --- a/spec/classes/trove_cache_spec.rb +++ b/spec/classes/trove_cache_spec.rb @@ -48,9 +48,11 @@ describe 'trove::cache' do :retry_attempts => '', :retry_delay => '', :hashclient_retry_attempts => '', - :hashclient_retry_delay => '', - :dead_timeout => '', + :hashclient_retry_timeout => '', + :hashclient_dead_timeout => '', :manage_backend_package => true, + :hashclient_retry_delay => nil, + :dead_timeout => nil, ) end end @@ -90,9 +92,11 @@ describe 'trove::cache' do :retry_attempts => 2, :retry_delay => 0, :hashclient_retry_attempts => 2, - :hashclient_retry_delay => 1, - :dead_timeout => 60, + :hashclient_retry_timeout => 1, + :hashclient_dead_timeout => 60, :manage_backend_package => false, + :hashclient_retry_delay => 3, + :dead_timeout => 61, } end @@ -135,9 +139,11 @@ describe 'trove::cache' do :retry_attempts => 2, :retry_delay => 0, :hashclient_retry_attempts => 2, - :hashclient_retry_delay => 1, - :dead_timeout => 60, + :hashclient_retry_timeout => 1, + :hashclient_dead_timeout => 60, :manage_backend_package => false, + :hashclient_retry_delay => 3, + :dead_timeout => 61, ) end end