Add HashClient retry options for the dogpile.cache backend

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 <hberaud@redhat.com>
Depends-On: https://review.opendev.org/826870
Change-Id: Iefecbae22a80e5218b43067536378beff72badbb
This commit is contained in:
Takashi Kajinami 2024-03-05 13:38:27 +09:00
parent f792373d70
commit 04e9a3657a
3 changed files with 37 additions and 0 deletions

View File

@ -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,
}
}

View File

@ -0,0 +1,6 @@
---
features:
- |
Add options to configure pymemcache's HashClient retrying mechanisms
(dogpile.cache) backend.

View File

@ -37,6 +37,9 @@ describe 'zaqar::cache' do
:enable_retry_client => '<SERVICE DEFAULT>',
:retry_attempts => '<SERVICE DEFAULT>',
:retry_delay => '<SERVICE DEFAULT>',
:hashclient_retry_attempts => '<SERVICE DEFAULT>',
:hashclient_retry_delay => '<SERVICE DEFAULT>',
:dead_timeout => '<SERVICE DEFAULT>',
: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