Add cache client retry options for the pymemcache backend

This patch specifies a set of options required to setup the retrying
wrapper feature of pymemcache (dogpile.cache) cache backend.

Original oslo.cache change:
https://review.opendev.org/c/openstack/oslo.cache/+/803747

Co-Authored-By: Hervé Beraud <hberaud@redhat.com>
Depends-On: https://review.opendev.org/826869
Change-Id: Ia0fa98ff49d63332eff8e4e377402d2527b1c595
This commit is contained in:
Takashi Kajinami 2024-03-05 13:36:48 +09:00
parent f7f8820d41
commit f792373d70
3 changed files with 34 additions and 0 deletions

View File

@ -145,6 +145,21 @@
# be available.
# Default to $facts['os_service_default']
#
# [*enable_retry_client*]
# (Optional) Enable retry client mechanisms to handle failure.
# Those mechanisms can be used to wrap all kind of pymemcache
# clients. The wrapper allows you to define how many attempts
# to make and how long to wait between attempts.
# Default to $facts['os_service_default']
#
# [*retry_attempts*]
# (Optional) Number of times to attempt an action before failing.
# Default to $facts['os_service_default']
#
# [*retry_delay*]
# (Optional) Number of seconds to sleep between each attempt.
# Default to $facts['os_service_default']
#
class zaqar::cache (
$config_prefix = $facts['os_service_default'],
$expiration_time = $facts['os_service_default'],
@ -170,6 +185,9 @@ class zaqar::cache (
$tls_certfile = $facts['os_service_default'],
$tls_keyfile = $facts['os_service_default'],
$tls_allowed_ciphers = $facts['os_service_default'],
$enable_retry_client = $facts['os_service_default'],
$retry_attempts = $facts['os_service_default'],
$retry_delay = $facts['os_service_default'],
) {
include zaqar::deps
@ -199,5 +217,8 @@ class zaqar::cache (
tls_certfile => $tls_certfile,
tls_keyfile => $tls_keyfile,
tls_allowed_ciphers => $tls_allowed_ciphers,
enable_retry_client => $enable_retry_client,
retry_attempts => $retry_attempts,
retry_delay => $retry_delay,
}
}

View File

@ -0,0 +1,4 @@
---
features:
- |
Add cache client retry options for the pymemcache (dogpile.cache) backend.

View File

@ -34,6 +34,9 @@ describe 'zaqar::cache' do
:tls_certfile => '<SERVICE DEFAULT>',
:tls_keyfile => '<SERVICE DEFAULT>',
:tls_allowed_ciphers => '<SERVICE DEFAULT>',
:enable_retry_client => '<SERVICE DEFAULT>',
:retry_attempts => '<SERVICE DEFAULT>',
:retry_delay => '<SERVICE DEFAULT>',
:manage_backend_package => true,
)
end
@ -60,6 +63,9 @@ describe 'zaqar::cache' do
:memcache_pool_connection_get_timeout => '360',
:memcache_pool_flush_on_reconnect => false,
:tls_enabled => false,
:enable_retry_client => false,
:retry_attempts => 2,
:retry_delay => 0,
:manage_backend_package => false,
}
end
@ -89,6 +95,9 @@ describe 'zaqar::cache' do
:tls_certfile => '<SERVICE DEFAULT>',
:tls_keyfile => '<SERVICE DEFAULT>',
:tls_allowed_ciphers => '<SERVICE DEFAULT>',
:enable_retry_client => false,
:retry_attempts => 2,
:retry_delay => 0,
:manage_backend_package => false,
)
end