Add RabbitMQ expiration policies for convergence

Right now heat can support convergence mode, means we will give it
chances to raise bug 1599104. We simply add policies for worker queues.
This fix services with interruption signal and leave the target queues
open. The number of queues keep growing by repeat above action.
This patch add a expiration for queues. allow queues to be close as
long as they didn't been used for a long period of time(1 hour).
This fix must solve problem with growing number of RabbitMQ queues.

Change-Id: Icda32000f391780c4e3d5d3ebcc519bf853283b7
Related-Bug: #1599104
(cherry picked from commit 46eed2a513)
This commit is contained in:
ricolin 2016-08-17 15:06:34 +08:00 committed by Maksim Malchuk
parent 7d658f8ace
commit d2bb3637b3
1 changed files with 4 additions and 2 deletions

View File

@ -4,7 +4,8 @@
# ${OCF_RESKEY_ctl} set_policy ha-all "." '{"ha-mode":"all", "ha-sync-mode":"automatic"}' --apply-to all --priority 0
if [ "${OCF_RESKEY_enable_rpc_ha}" = 'true' ] ; then
${OCF_RESKEY_ctl} set_policy heat_rpc_expire "^heat-engine-listener\\." '{"expires":3600000, "ha-mode":"all", "ha-sync-mode":"automatic"}' --apply-to all --priority 1
${OCF_RESKEY_ctl} set_policy heat_engine_rpc_expire "^heat-engine-listener\\." '{"expires":3600000, "ha-mode":"all", "ha-sync-mode":"automatic"}' --apply-to all --priority 1
${OCF_RESKEY_ctl} set_policy heat_worker_rpc_expire "^engine_worker\\." '{"expires":3600000, "ha-mode":"all", "ha-sync-mode":"automatic"}' --apply-to all --priority 1
${OCF_RESKEY_ctl} set_policy results_expire "^results\\." '{"expires":3600000, "ha-mode":"all", "ha-sync-mode":"automatic"}' --apply-to all --priority 1
${OCF_RESKEY_ctl} set_policy tasks_expire "^tasks\\." '{"expires":3600000, "ha-mode":"all", "ha-sync-mode":"automatic"}' --apply-to all --priority 1
@ -19,7 +20,8 @@ if [ "${OCF_RESKEY_enable_rpc_ha}" = 'true' ] ; then
else
ocf_log info "${LH} Do not set HA policy for all queues"
${OCF_RESKEY_ctl} set_policy heat_rpc_expire "^heat-engine-listener\\." '{"expires":3600000}' --apply-to all --priority 1
${OCF_RESKEY_ctl} set_policy heat_engine_rpc_expire "^heat-engine-listener\\." '{"expires":3600000}' --apply-to all --priority 1
${OCF_RESKEY_ctl} set_policy heat_worker_rpc_expire "^engine_worker\\." '{"expires":3600000}' --apply-to all --priority 1
${OCF_RESKEY_ctl} set_policy results_expire "^results\\." '{"expires":3600000}' --apply-to all --priority 1
${OCF_RESKEY_ctl} set_policy tasks_expire "^tasks\\." '{"expires":3600000}' --apply-to all --priority 1