Add a flag to rabbitmq so that we can deploy with ha-mode: all again

In change Ib62001c03e1e08f58cf0c6e0ba07a8879a584084 we switched the
rabbitmq queues HA mode from ha-all to ha-exactly. While this gives us a
nice performance boost with rabbitmq, it makes rabbit less resilient to
network glitches as we painfully found out via
https://bugzilla.redhat.com/show_bug.cgi?id=1441635.

Will propose another THT change to actually change the default to
-1 so we get this ha-mode:all by default.

Change-Id: I9a90e71094b8d8d58b5be0a45a2979701b0ac21c
Partial-Bug: #1686337
Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com>
Co-Authored-By: John Eckersberg <jeckersb@redhat.com>
(cherry picked from commit c504d6a859)
This commit is contained in:
Michele Baldessari 2017-04-26 10:12:50 +02:00
parent 56c91af646
commit 0eeee9a587
1 changed files with 6 additions and 2 deletions

View File

@ -30,7 +30,7 @@
# (Optional) The number of HA queues in to be configured in rabbitmq
# Defaults to hiera('rabbitmq::nr_ha_queues'), which is usually 0 meaning
# that the queues number will be CEIL(N/2) where N is the number of rabbitmq
# nodes.
# nodes. The special value of -1 represents the mode 'ha-mode: all'
#
# [*rabbit_nodes*]
# (Optional) The list of rabbitmq nodes names
@ -90,12 +90,16 @@ class tripleo::profile::pacemaker::rabbitmq (
if $user_ha_queues == 0 {
$nr_rabbit_nodes = size($rabbit_nodes)
$nr_ha_queues = $nr_rabbit_nodes / 2 + ($nr_rabbit_nodes % 2)
$params = "set_policy='ha-all ^(?!amq\\.).* {\"ha-mode\":\"exactly\",\"ha-params\":${nr_ha_queues}}'"
} elsif $user_ha_queues == -1 {
$params = 'set_policy=\'ha-all ^(?!amq\.).* {"ha-mode":"all"}\''
} else {
$nr_ha_queues = $user_ha_queues
$params = "set_policy='ha-all ^(?!amq\\.).* {\"ha-mode\":\"exactly\",\"ha-params\":${nr_ha_queues}}'"
}
pacemaker::resource::ocf { 'rabbitmq':
ocf_agent_name => 'heartbeat:rabbitmq-cluster',
resource_params => "set_policy='ha-all ^(?!amq\\.).* {\"ha-mode\":\"exactly\",\"ha-params\":${nr_ha_queues}}'",
resource_params => $params,
clone_params => 'ordered=true interleave=true',
meta_params => 'notify=true',
op_params => 'start timeout=200s stop timeout=200s',