From 4504420e4f45ef64097425f918cc609915c6ba66 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Thu, 13 Mar 2025 12:44:46 +0100 Subject: [PATCH] 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 octavia_config to set it, so this patch is mandatory for one to set rabbit_transient_queues_ttl in octavia.conf. Change-Id: I676917dce07b6490cb34eba876be48a67194dea0 --- manifests/init.pp | 16 ++++++++++++++++ .../notes/amqp_auto_delete-2a8027b3f6ca4bc6.yaml | 5 +++++ ...it_transient_queues_ttl-e128789222dee23c.yaml | 6 ++++++ spec/classes/octavia_init_spec.rb | 6 ++++++ 4 files changed, 33 insertions(+) create mode 100644 releasenotes/notes/amqp_auto_delete-2a8027b3f6ca4bc6.yaml create mode 100644 releasenotes/notes/rabbit_transient_queues_ttl-e128789222dee23c.yaml diff --git a/manifests/init.pp b/manifests/init.pp index 2967d4f2..4dba6cc9 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -63,6 +63,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 @@ -117,6 +125,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*] # (optional) Define queues as "durable" to rabbitmq. # Defaults to $facts['os_service_default'] @@ -174,6 +186,7 @@ class octavia ( $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'], @@ -187,6 +200,7 @@ class octavia ( $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'], $notification_transport_url = $facts['os_service_default'], $notification_driver = $facts['os_service_default'], $notification_topics = $facts['os_service_default'], @@ -225,8 +239,10 @@ class octavia ( kombu_ssl_ca_certs => $kombu_ssl_ca_certs, kombu_compression => $kombu_compression, amqp_durable_queues => $amqp_durable_queues, + amqp_auto_delete => $amqp_auto_delete, 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, diff --git a/releasenotes/notes/amqp_auto_delete-2a8027b3f6ca4bc6.yaml b/releasenotes/notes/amqp_auto_delete-2a8027b3f6ca4bc6.yaml new file mode 100644 index 00000000..bb24709f --- /dev/null +++ b/releasenotes/notes/amqp_auto_delete-2a8027b3f6ca4bc6.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Add a new ``amqp_auto_delete`` parameter, so that transient queues are + automatically deleted. diff --git a/releasenotes/notes/rabbit_transient_queues_ttl-e128789222dee23c.yaml b/releasenotes/notes/rabbit_transient_queues_ttl-e128789222dee23c.yaml new file mode 100644 index 00000000..16469e69 --- /dev/null +++ b/releasenotes/notes/rabbit_transient_queues_ttl-e128789222dee23c.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + A new parameter ``rabbit_transient_queues_ttl`` has been added to the + octavia class to configure how long transient queue should stay until + they are automatically deleted. diff --git a/spec/classes/octavia_init_spec.rb b/spec/classes/octavia_init_spec.rb index ad553062..23c94d3d 100644 --- a/spec/classes/octavia_init_spec.rb +++ b/spec/classes/octavia_init_spec.rb @@ -49,8 +49,10 @@ describe 'octavia' do :kombu_ssl_ca_certs => '', :kombu_compression => '', :amqp_durable_queues => '', + :amqp_auto_delete => '', :rabbit_quorum_queue => '', :rabbit_transient_quorum_queue => '', + :rabbit_transient_queues_ttl => '', :rabbit_quorum_delivery_limit => '', :rabbit_quorum_max_memory_length => '', :rabbit_quorum_max_memory_bytes => '', @@ -83,6 +85,7 @@ describe 'octavia' 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, @@ -91,6 +94,7 @@ describe 'octavia' do :kombu_reconnect_delay => '5.0', :kombu_failover_strategy => 'shuffle', :amqp_durable_queues => true, + :amqp_auto_delete => true, :package_ensure => '2012.1.1-15.el6', :notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673', :notification_driver => 'ceilometer.compute.octavia_notifier', @@ -122,8 +126,10 @@ describe 'octavia' do :kombu_ssl_ca_certs => '', :kombu_compression => 'gzip', :amqp_durable_queues => true, + :amqp_auto_delete => true, :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,