From bcb7ab0a74e863278b2c0fcc868f96939ea6012c Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 27 Sep 2024 10:58:35 +0900 Subject: [PATCH] Add support for [oslo_messaging_rabbit] enable_cancel_on_failover Depends-on: https://review.opendev.org/928440 Change-Id: Ibb08e40882a3e5fb5ae4a6b8d43673b4251e2a1e --- manifests/init.pp | 7 +++ ...e_cancel_on_failover-10be3434f6479029.yaml | 5 ++ spec/classes/cloudkitty_init_spec.rb | 61 ++++++++++--------- 3 files changed, 44 insertions(+), 29 deletions(-) create mode 100644 releasenotes/notes/enable_cancel_on_failover-10be3434f6479029.yaml diff --git a/manifests/init.pp b/manifests/init.pp index 1fa4684..28dbd3b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -55,6 +55,11 @@ # (Optional) Limit the number of memory bytes used by the quorum queue. # Defaults to $facts['os_service_default'] # +# [*rabbit_enable_cancel_on_failover*] +# (Optional) Enable x-cancel-on-ha-failover flag so that rabbitmq server will +# cancel and notify consumers when queue is down. +# Defaults to $facts['os_service_default'] +# # [*rabbit_use_ssl*] # (Optional) Connect over SSL for RabbitMQ. # Defaults to $facts['os_service_default']. @@ -193,6 +198,7 @@ class cloudkitty( $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'], + $rabbit_enable_cancel_on_failover = $facts['os_service_default'], $kombu_ssl_ca_certs = $facts['os_service_default'], $kombu_ssl_certfile = $facts['os_service_default'], $kombu_ssl_keyfile = $facts['os_service_default'], @@ -255,6 +261,7 @@ class cloudkitty( 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, + enable_cancel_on_failover => $rabbit_enable_cancel_on_failover, } oslo::messaging::default { 'cloudkitty_config': diff --git a/releasenotes/notes/enable_cancel_on_failover-10be3434f6479029.yaml b/releasenotes/notes/enable_cancel_on_failover-10be3434f6479029.yaml new file mode 100644 index 0000000..fb81ec6 --- /dev/null +++ b/releasenotes/notes/enable_cancel_on_failover-10be3434f6479029.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``cloudkitty::rabbit_enable_cancel_on_failover`` parameter has been + added. diff --git a/spec/classes/cloudkitty_init_spec.rb b/spec/classes/cloudkitty_init_spec.rb index 9decbf0..d0ea50d 100644 --- a/spec/classes/cloudkitty_init_spec.rb +++ b/spec/classes/cloudkitty_init_spec.rb @@ -28,24 +28,25 @@ describe 'cloudkitty' do :control_exchange => '' ) is_expected.to contain_oslo__messaging__rabbit('cloudkitty_config').with( - :rabbit_use_ssl => '', - :heartbeat_timeout_threshold => '', - :heartbeat_rate => '', - :heartbeat_in_pthread => '', - :kombu_reconnect_delay => '', - :kombu_failover_strategy => '', - :amqp_durable_queues => '', - :kombu_compression => '', - :kombu_ssl_ca_certs => '', - :kombu_ssl_certfile => '', - :kombu_ssl_keyfile => '', - :kombu_ssl_version => '', - :rabbit_ha_queues => '', - :rabbit_retry_interval => '', - :rabbit_quorum_queue => '', - :rabbit_quorum_delivery_limit => '', - :rabbit_quorum_max_memory_length => '', - :rabbit_quorum_max_memory_bytes => '', + :rabbit_use_ssl => '', + :heartbeat_timeout_threshold => '', + :heartbeat_rate => '', + :heartbeat_in_pthread => '', + :kombu_reconnect_delay => '', + :kombu_failover_strategy => '', + :amqp_durable_queues => '', + :kombu_compression => '', + :kombu_ssl_ca_certs => '', + :kombu_ssl_certfile => '', + :kombu_ssl_keyfile => '', + :kombu_ssl_version => '', + :rabbit_ha_queues => '', + :rabbit_retry_interval => '', + :rabbit_quorum_queue => '', + :rabbit_quorum_delivery_limit => '', + :rabbit_quorum_max_memory_length => '', + :rabbit_quorum_max_memory_bytes => '', + :enable_cancel_on_failover => '', ) is_expected.to contain_oslo__messaging__notifications('cloudkitty_config').with( :transport_url => '', @@ -78,6 +79,7 @@ describe 'cloudkitty' do :rabbit_quorum_delivery_limit => 3, :rabbit_quorum_max_memory_length => 5, :rabbit_quorum_max_memory_bytes => 1073741824, + :rabbit_enable_cancel_on_failover => false, :kombu_reconnect_delay => 5.0, :amqp_durable_queues => true, :kombu_compression => 'gzip', @@ -99,17 +101,18 @@ describe 'cloudkitty' do :control_exchange => 'cloudkitty' ) is_expected.to contain_oslo__messaging__rabbit('cloudkitty_config').with( - :heartbeat_timeout_threshold => 60, - :heartbeat_rate => 10, - :heartbeat_in_pthread => true, - :kombu_reconnect_delay => 5.0, - :amqp_durable_queues => true, - :kombu_compression => 'gzip', - :rabbit_ha_queues => true, - :rabbit_quorum_queue => true, - :rabbit_quorum_delivery_limit => 3, - :rabbit_quorum_max_memory_length => 5, - :rabbit_quorum_max_memory_bytes => 1073741824, + :heartbeat_timeout_threshold => 60, + :heartbeat_rate => 10, + :heartbeat_in_pthread => true, + :kombu_reconnect_delay => 5.0, + :amqp_durable_queues => true, + :kombu_compression => 'gzip', + :rabbit_ha_queues => true, + :rabbit_quorum_queue => true, + :rabbit_quorum_delivery_limit => 3, + :rabbit_quorum_max_memory_length => 5, + :rabbit_quorum_max_memory_bytes => 1073741824, + :enable_cancel_on_failover => false, ) is_expected.to contain_oslo__messaging__notifications('cloudkitty_config').with( :transport_url => '',