Add a rabbit_transient_queues_ttl and amqp_auto_delete params

The amqp_auto_delete option needs this patch:
https://review.opendev.org/c/openstack/puppet-oslo/+/944132

Since transient_queues_ttl is also managed by oslo::messaging::rabbit,
there's no way to use cinder_config to set it, so this patch is
mandatory for one to set rabbit_transient_queues_ttl in cinder.conf.

Change-Id: I8f59ef9186431cdc377cf9060d179f2beb253944
This commit is contained in:
Thomas Goirand 2025-03-13 11:59:58 +01:00 committed by Takashi Kajinami
parent 2fe578de0e
commit 7a9f9abc96
4 changed files with 31 additions and 0 deletions

View File

@ -76,6 +76,14 @@
# (Optional) Use quorum queues for transients queues in RabbitMQ.
# Defaults to $facts['os_service_default']
#
# [*rabbit_transient_queues_ttl*]
# (Optional) Positive integer representing duration in seconds for
# queue TTL (x-expires). Queues which are unused for the duration
# of the TTL are automatically deleted.
# The parameter affects only reply and fanout queues. (integer value)
# Min to 1
# Defaults to $facts['os_service_default']
#
# [*rabbit_quorum_delivery_limit*]
# (Optional) Each time a message is rdelivered to a consumer, a counter is
# incremented. Once the redelivery count exceeds the delivery limit
@ -144,6 +152,10 @@
# (string value)
# Defaults to $facts['os_service_default']
#
# [*amqp_auto_delete*]
# (Optional) Define if transient queues should be auto-deleted (boolean value)
# Defaults to $facts['os_service_default']
#
# [*amqp_durable_queues*]
# Use durable queues in amqp.
# (Optional) Defaults to $facts['os_service_default']
@ -251,6 +263,7 @@ class cinder (
$rabbit_qos_prefetch_count = $facts['os_service_default'],
$rabbit_quorum_queue = $facts['os_service_default'],
$rabbit_transient_quorum_queue = $facts['os_service_default'],
$rabbit_transient_queues_ttl = $facts['os_service_default'],
$rabbit_quorum_delivery_limit = $facts['os_service_default'],
$rabbit_quorum_max_memory_length = $facts['os_service_default'],
$rabbit_quorum_max_memory_bytes = $facts['os_service_default'],
@ -266,6 +279,7 @@ class cinder (
$kombu_failover_strategy = $facts['os_service_default'],
$kombu_compression = $facts['os_service_default'],
$amqp_durable_queues = $facts['os_service_default'],
$amqp_auto_delete = $facts['os_service_default'],
$package_ensure = 'present',
$api_paste_config = '/etc/cinder/api-paste.ini',
$storage_availability_zone = $facts['os_service_default'],
@ -314,9 +328,11 @@ class cinder (
kombu_ssl_certfile => $kombu_ssl_certfile,
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
amqp_durable_queues => $amqp_durable_queues,
amqp_auto_delete => $amqp_auto_delete,
kombu_compression => $kombu_compression,
rabbit_quorum_queue => $rabbit_quorum_queue,
rabbit_transient_quorum_queue => $rabbit_transient_quorum_queue,
rabbit_transient_queues_ttl => $rabbit_transient_queues_ttl,
rabbit_quorum_delivery_limit => $rabbit_quorum_delivery_limit,
rabbit_quorum_max_memory_length => $rabbit_quorum_max_memory_length,
rabbit_quorum_max_memory_bytes => $rabbit_quorum_max_memory_bytes,

View File

@ -0,0 +1,5 @@
---
features:
- |
Add a new ``amqp_auto_delete`` parameter, so that transient queues are
automatically deleted.

View File

@ -0,0 +1,6 @@
---
features:
- |
A new parameter ``rabbit_transient_queues_ttl`` has been added to the
cinder class to configure how long transient queue should stay until
they are automatically deleted.

View File

@ -33,6 +33,7 @@ describe 'cinder' do
:kombu_reconnect_delay => '<SERVICE DEFAULT>',
:kombu_failover_strategy => '<SERVICE DEFAULT>',
:amqp_durable_queues => '<SERVICE DEFAULT>',
:amqp_auto_delete => '<SERVICE DEFAULT>',
:kombu_compression => '<SERVICE DEFAULT>',
:kombu_ssl_ca_certs => '<SERVICE DEFAULT>',
:kombu_ssl_certfile => '<SERVICE DEFAULT>',
@ -42,6 +43,7 @@ describe 'cinder' do
:rabbit_retry_interval => '<SERVICE DEFAULT>',
:rabbit_quorum_queue => '<SERVICE DEFAULT>',
:rabbit_transient_quorum_queue => '<SERVICE DEFAULT>',
:rabbit_transient_queues_ttl => '<SERVICE DEFAULT>',
:rabbit_quorum_delivery_limit => '<SERVICE DEFAULT>',
:rabbit_quorum_max_memory_length => '<SERVICE DEFAULT>',
:rabbit_quorum_max_memory_bytes => '<SERVICE DEFAULT>',
@ -102,6 +104,7 @@ describe 'cinder' do
:rabbit_qos_prefetch_count => 0,
:rabbit_quorum_queue => true,
:rabbit_transient_quorum_queue => true,
:rabbit_transient_queues_ttl => 60,
:rabbit_quorum_delivery_limit => 3,
:rabbit_quorum_max_memory_length => 5,
:rabbit_quorum_max_memory_bytes => 1073741824,
@ -116,6 +119,7 @@ describe 'cinder' do
:rabbit_qos_prefetch_count => 0,
:rabbit_quorum_queue => true,
:rabbit_transient_quorum_queue => true,
:rabbit_transient_queues_ttl => 60,
:rabbit_quorum_delivery_limit => 3,
:rabbit_quorum_max_memory_length => 5,
:rabbit_quorum_max_memory_bytes => 1073741824,