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: Ibb917053505bb81146279f82824b8d82d8c5698b
This commit is contained in:
Takashi Kajinami 2022-02-16 11:36:22 +09:00
parent 882a91a64c
commit b90330ba8b
3 changed files with 36 additions and 0 deletions

View File

@ -159,6 +159,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 keystone::cache(
$config_prefix = $::os_service_default,
$expiration_time = $::os_service_default,
@ -187,6 +203,9 @@ class keystone::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 keystone::deps
@ -226,6 +245,9 @@ class keystone::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,5 @@
---
features:
- |
Add options to configure pymemcache's HashClient retrying mechanisms
(dogpile.cache) backend.

View File

@ -38,6 +38,9 @@ describe 'keystone::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 'keystone::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,
:token_caching => true,
}
@ -100,6 +106,9 @@ describe 'keystone::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