Expose tunable options for RabbitMQ heartbeat

These have been supported by puppet-oslo, but haven't been configurable
in this module.

Change-Id: I7dbb782f2b95f9bc2f0b7a98fe1363f9ef74475f
This commit is contained in:
Takashi Kajinami
2024-09-25 19:28:57 +09:00
parent 413ac43c4f
commit 5fdb3a7a24
3 changed files with 74 additions and 42 deletions

View File

@@ -53,6 +53,21 @@
# option, you must wipe the RabbitMQ database. (boolean value).
# Defaults to $facts['os_service_default']
#
# [*rabbit_heartbeat_timeout_threshold*]
# (optional) Number of seconds after which the RabbitMQ broker is considered
# down if the heartbeat keepalive fails. Any value >0 enables heartbeats.
# Heartbeating helps to ensure the TCP connection to RabbitMQ isn't silently
# closed, resulting in missed or lost messages from the queue.
# (Requires kombu >= 3.0.7 and amqp >= 1.4.0)
# Defaults to $facts['os_service_default']
#
# [*rabbit_heartbeat_rate*]
# (optional) How often during the rabbit_heartbeat_timeout_threshold period to
# check the heartbeat on RabbitMQ connection. (i.e. rabbit_heartbeat_rate=2
# when rabbit_heartbeat_timeout_threshold=60, the heartbeat will be checked
# every 30 seconds.
# Defaults to $facts['os_service_default']
#
# [*rabbit_heartbeat_in_pthread*]
# (Optional) EXPERIMENTAL: Run the health check heartbeat thread
# through a native python thread. By default if this
@@ -149,37 +164,39 @@
# Defaults to $facts['os_service_default'].
#
class designate(
$package_ensure = present,
$common_package_name = $::designate::params::common_package_name,
$host = $facts['os_service_default'],
$root_helper = 'sudo designate-rootwrap /etc/designate/rootwrap.conf',
$state_path = $::designate::params::state_path,
$rabbit_use_ssl = $facts['os_service_default'],
$rabbit_ha_queues = $facts['os_service_default'],
$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_quorum_queue = $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'],
$kombu_ssl_ca_certs = $facts['os_service_default'],
$kombu_ssl_certfile = $facts['os_service_default'],
$kombu_ssl_keyfile = $facts['os_service_default'],
$kombu_ssl_version = $facts['os_service_default'],
$kombu_reconnect_delay = $facts['os_service_default'],
$kombu_failover_strategy = $facts['os_service_default'],
$default_transport_url = $facts['os_service_default'],
$rpc_response_timeout = $facts['os_service_default'],
$control_exchange = $facts['os_service_default'],
$executor_thread_pool_size = $facts['os_service_default'],
$notification_driver = $facts['os_service_default'],
$notification_transport_url = $facts['os_service_default'],
$notification_topics = $facts['os_service_default'],
Boolean $purge_config = false,
$amqp_durable_queues = $facts['os_service_default'],
$default_ttl = $facts['os_service_default'],
$supported_record_type = $facts['os_service_default'],
$package_ensure = present,
$common_package_name = $::designate::params::common_package_name,
$host = $facts['os_service_default'],
$root_helper = 'sudo designate-rootwrap /etc/designate/rootwrap.conf',
$state_path = $::designate::params::state_path,
$rabbit_use_ssl = $facts['os_service_default'],
$rabbit_ha_queues = $facts['os_service_default'],
$rabbit_heartbeat_timeout_threshold = $facts['os_service_default'],
$rabbit_heartbeat_rate = $facts['os_service_default'],
$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_quorum_queue = $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'],
$kombu_ssl_ca_certs = $facts['os_service_default'],
$kombu_ssl_certfile = $facts['os_service_default'],
$kombu_ssl_keyfile = $facts['os_service_default'],
$kombu_ssl_version = $facts['os_service_default'],
$kombu_reconnect_delay = $facts['os_service_default'],
$kombu_failover_strategy = $facts['os_service_default'],
$default_transport_url = $facts['os_service_default'],
$rpc_response_timeout = $facts['os_service_default'],
$control_exchange = $facts['os_service_default'],
$executor_thread_pool_size = $facts['os_service_default'],
$notification_driver = $facts['os_service_default'],
$notification_transport_url = $facts['os_service_default'],
$notification_topics = $facts['os_service_default'],
Boolean $purge_config = false,
$amqp_durable_queues = $facts['os_service_default'],
$default_ttl = $facts['os_service_default'],
$supported_record_type = $facts['os_service_default'],
) inherits designate::params {
include designate::deps
@@ -203,6 +220,8 @@ class designate(
kombu_failover_strategy => $kombu_failover_strategy,
rabbit_use_ssl => $rabbit_use_ssl,
rabbit_ha_queues => $rabbit_ha_queues,
heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold,
heartbeat_rate => $rabbit_heartbeat_rate,
heartbeat_in_pthread => $rabbit_heartbeat_in_pthread,
rabbit_qos_prefetch_count => $rabbit_qos_prefetch_count,
amqp_durable_queues => $amqp_durable_queues,

View File

@@ -0,0 +1,7 @@
---
features:
- |
The following parameters have been added to the ``designate`` class.
- ``rabbit_heartbeat_timeout_threshold``
- ``rabbit_heartbeat_rate``

View File

@@ -115,6 +115,8 @@ describe 'designate' do
:kombu_failover_strategy => '<SERVICE DEFAULT>',
:rabbit_use_ssl => '<SERVICE DEFAULT>',
:rabbit_ha_queues => '<SERVICE DEFAULT>',
:heartbeat_timeout_threshold => '<SERVICE DEFAULT>',
:heartbeat_rate => '<SERVICE DEFAULT>',
:heartbeat_in_pthread => '<SERVICE DEFAULT>',
:rabbit_qos_prefetch_count => '<SERVICE DEFAULT>',
:amqp_durable_queues => '<SERVICE DEFAULT>',
@@ -131,17 +133,19 @@ describe 'designate' do
shared_examples_for 'rabbit transport' do
before do
params.merge!({
:default_transport_url => 'rabbit://designate:secret@127.0.0.1:5672/designate',
:rabbit_ha_queues => true,
:rabbit_heartbeat_in_pthread => true,
:rabbit_qos_prefetch_count => 0,
:rabbit_quorum_queue => true,
:rabbit_transient_quorum_queue => true,
:rabbit_quorum_delivery_limit => 3,
:rabbit_quorum_max_memory_length => 5,
:rabbit_quorum_max_memory_bytes => 1073741824,
:kombu_reconnect_delay => '1.0',
:kombu_failover_strategy => 'shuffle',
:default_transport_url => 'rabbit://designate:secret@127.0.0.1:5672/designate',
:rabbit_ha_queues => true,
:rabbit_heartbeat_timeout_threshold => '60',
:rabbit_heartbeat_rate => '10',
:rabbit_heartbeat_in_pthread => true,
:rabbit_qos_prefetch_count => 0,
:rabbit_quorum_queue => true,
:rabbit_transient_quorum_queue => true,
:rabbit_quorum_delivery_limit => 3,
:rabbit_quorum_max_memory_length => 5,
:rabbit_quorum_max_memory_bytes => 1073741824,
:kombu_reconnect_delay => '1.0',
:kombu_failover_strategy => 'shuffle',
})
end
@@ -150,6 +154,8 @@ describe 'designate' do
) }
it { is_expected.to contain_oslo__messaging__rabbit('designate_config').with(
:rabbit_ha_queues => true,
:heartbeat_timeout_threshold => '60',
:heartbeat_rate => '10',
:heartbeat_in_pthread => true,
:rabbit_qos_prefetch_count => 0,
:rabbit_quorum_queue => true,