File: Add-amqp_auto_delete-and-rabbit_transient_queues_ttl-params.patch

package info (click to toggle)
puppet-module-nova 25.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,100 kB
  • sloc: ruby: 11,433; python: 38; sh: 10; makefile: 10
file content (145 lines) | stat: -rw-r--r-- 7,730 bytes parent folder | download
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
Author: Thomas Goirand <zigo@debian.org>
Date: Mon, 17 Mar 2025 17:14:55 +0100
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 nova_config to set it, so this patch is mandatory
 for one to set rabbit_transient_queues_ttl in nova.conf.
Change-Id: I6aa11906d47c0251e0792637cb940f9f2a8fe425
Forwarded: https://review.opendev.org/c/openstack/puppet-nova/+/944785
Last-Update: 2025-03-18

Index: puppet-module-nova/manifests/init.pp
===================================================================
--- puppet-module-nova.orig/manifests/init.pp
+++ puppet-module-nova/manifests/init.pp
@@ -79,6 +79,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
@@ -139,6 +147,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. (boolean value)
 #   Defaults to $facts['os_service_default']
@@ -348,6 +360,7 @@ class nova(
   $rabbit_qos_prefetch_count               = $facts['os_service_default'],
   $rabbit_ha_queues                        = $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'],
@@ -362,6 +375,7 @@ class nova(
   $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'],
   $host                                    = $facts['os_service_default'],
   $service_down_time                       = $facts['os_service_default'],
   $state_path                              = '/var/lib/nova',
@@ -506,6 +520,7 @@ class nova(
     kombu_reconnect_delay           => $kombu_reconnect_delay,
     kombu_failover_strategy         => $kombu_failover_strategy,
     amqp_durable_queues             => $amqp_durable_queues,
+    amqp_auto_delete                => $amqp_auto_delete,
     kombu_compression               => $kombu_compression,
     kombu_ssl_ca_certs              => $kombu_ssl_ca_certs,
     kombu_ssl_certfile              => $kombu_ssl_certfile,
@@ -514,6 +529,7 @@ class nova(
     rabbit_ha_queues                => $rabbit_ha_queues,
     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-nova/releasenotes/notes/amqp_auto_delete-c452bf98830afe1a.yaml
===================================================================
--- /dev/null
+++ puppet-module-nova/releasenotes/notes/amqp_auto_delete-c452bf98830afe1a.yaml
@@ -0,0 +1,5 @@
+---
+features:
+  - |
+    Add a new ``amqp_auto_delete`` parameter, so that transient queues are
+    automatically deleted.
Index: puppet-module-nova/releasenotes/notes/rabbit_transient_queues_ttl-f1b43dda25844321.yaml
===================================================================
--- /dev/null
+++ puppet-module-nova/releasenotes/notes/rabbit_transient_queues_ttl-f1b43dda25844321.yaml
@@ -0,0 +1,6 @@
+---
+features:
+  - |
+    A new parameter ``rabbit_transient_queues_ttl`` has been added to the
+    nova class to configure how long transtient queue should stay until
+    they are automatically deleted.
Index: puppet-module-nova/spec/classes/nova_init_spec.rb
===================================================================
--- puppet-module-nova.orig/spec/classes/nova_init_spec.rb
+++ puppet-module-nova/spec/classes/nova_init_spec.rb
@@ -45,6 +45,7 @@ describe 'nova' 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>',
@@ -53,6 +54,7 @@ describe 'nova' 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>',
@@ -113,6 +115,7 @@ describe 'nova' do
           :rabbit_qos_prefetch_count          => 0,
           :kombu_reconnect_delay              => '5.0',
           :amqp_durable_queues                => true,
+          :amqp_auto_delete                   => true,
           :kombu_compression                  => 'gzip',
           :kombu_ssl_ca_certs                 => '/etc/ca.cert',
           :kombu_ssl_certfile                 => '/etc/certfile',
@@ -121,6 +124,7 @@ describe 'nova' do
           :rabbit_ha_queues                   => 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,
@@ -188,6 +192,7 @@ describe 'nova' do
           :rabbit_qos_prefetch_count       => 0,
           :kombu_reconnect_delay           => '5.0',
           :amqp_durable_queues             => true,
+          :amqp_auto_delete                => true,
           :kombu_compression               => 'gzip',
           :kombu_ssl_ca_certs              => '/etc/ca.cert',
           :kombu_ssl_certfile              => '/etc/certfile',
@@ -196,6 +201,7 @@ describe 'nova' do
           :rabbit_ha_queues                => 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,