1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
Description: Add a rabbit_transient_queues_ttl and amqp_auto_delete params
Since transient_queues_ttl is also managed by oslo::messaging::rabbit,
there's no way to use mistral_config to set it, so this patch is mandatory
for one to set rabbit_transient_queues_ttl in mistral.conf.
Author: Thomas Goirand <zigo@debian.org>
Date: Tue, 18 Mar 2025 10:47:12 +0100
Change-Id: I425b29f8511403de0afc82479face47f8d6d354e
Forwarded: https://review.opendev.org/c/openstack/puppet-mistral/+/944847
Last-Update: 2025-03-26
Index: puppet-module-mistral/manifests/init.pp
===================================================================
--- puppet-module-mistral.orig/manifests/init.pp
+++ puppet-module-mistral/manifests/init.pp
@@ -75,6 +75,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
@@ -137,6 +145,10 @@
# consumer cancel notification.
# 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)Use durable queues in amqp.
# Defaults to $facts['os_service_default']
@@ -198,6 +210,7 @@ class mistral(
$rabbit_heartbeat_in_pthread = $facts['os_service_default'],
$rabbit_qos_prefetch_count = $facts['os_service_default'],
$rabbit_quorum_queue = $facts['os_service_default'],
+ $rabbit_transient_queues_ttl = $facts['os_service_default'],
$rabbit_transient_quorum_queue = $facts['os_service_default'],
$rabbit_quorum_delivery_limit = $facts['os_service_default'],
$rabbit_quorum_max_memory_length = $facts['os_service_default'],
@@ -213,6 +226,7 @@ class mistral(
$kombu_ssl_version = $facts['os_service_default'],
$kombu_reconnect_delay = $facts['os_service_default'],
$amqp_durable_queues = $facts['os_service_default'],
+ $amqp_auto_delete = $facts['os_service_default'],
Boolean $purge_config = false,
Boolean $sync_db = true,
$max_missed_heartbeats = $facts['os_service_default'],
@@ -273,8 +287,10 @@ class mistral(
heartbeat_in_pthread => $rabbit_heartbeat_in_pthread,
rabbit_qos_prefetch_count => $rabbit_qos_prefetch_count,
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,
Index: puppet-module-mistral/releasenotes/notes/amqp_auto_delete-8552b7085fdbb335.yaml
===================================================================
--- /dev/null
+++ puppet-module-mistral/releasenotes/notes/amqp_auto_delete-8552b7085fdbb335.yaml
@@ -0,0 +1,5 @@
+---
+features:
+ - |
+ Add a new ``amqp_auto_delete`` parameter, so that transient queues are
+ automatically deleted.
Index: puppet-module-mistral/releasenotes/notes/rabbit_transient_queues_ttl-c4243834920ec44d.yaml
===================================================================
--- /dev/null
+++ puppet-module-mistral/releasenotes/notes/rabbit_transient_queues_ttl-c4243834920ec44d.yaml
@@ -0,0 +1,6 @@
+---
+features:
+ - |
+ A new parameter ``rabbit_transient_queues_ttl`` has been added to the
+ mistral class to configure how long transtient queue should stay until
+ they are automatically deleted.
Index: puppet-module-mistral/spec/classes/mistral_init_spec.rb
===================================================================
--- puppet-module-mistral.orig/spec/classes/mistral_init_spec.rb
+++ puppet-module-mistral/spec/classes/mistral_init_spec.rb
@@ -46,6 +46,7 @@ describe 'mistral' do
:kombu_reconnect_delay => '<SERVICE DEFAULT>',
:kombu_failover_strategy => '<SERVICE DEFAULT>',
:amqp_durable_queues => '<SERVICE DEFAULT>',
+ :amqp_auto_delete => '<SERVICE DEFAULT>',
:kombu_ssl_ca_certs => '<SERVICE DEFAULT>',
:kombu_ssl_certfile => '<SERVICE DEFAULT>',
:kombu_ssl_keyfile => '<SERVICE DEFAULT>',
@@ -53,6 +54,7 @@ describe 'mistral' do
:rabbit_ha_queues => '<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>',
|