Add force_boot command to rabbit start template

Currently, if a multi-node cluster is shut down unexpectedly,
RabbitMQ is not able to boot and sync with the other nodes.

The purpose of this change is to add the possibility to use the
rabbitmqctl force_boot command to recover RabbitMQ cluster from
an unexpected shut down.

Test plan:
PASS: Shutdown and start a multi-node RabbitMQ cluster

Regression:
PASS: OpenStack can be applied successfully
PASS: RabbitMQ nodes can join the RabbitMQ cluster

Story: 2009784
Task: 44290

Ref:
[0] https://www.rabbitmq.com/rabbitmqctl.8.html#force_boot

Signed-off-by: Maik Catrinque <maik.wandercatrinqueandrade@windriver.com>
Co-authored-by: Andrew Martins Carletti <Andrew.MartinsCarletti@windriver.com>
Change-Id: I56e966ea64e8881ba436213f0c9e1cbe547098e3
This commit is contained in:
Maik Catrinque 2022-01-14 15:07:40 -03:00
parent 9d7baa9aa8
commit a0206d9626
4 changed files with 11 additions and 1 deletions

View File

@ -15,6 +15,6 @@ apiVersion: v1
appVersion: v3.7.26
description: OpenStack-Helm RabbitMQ
name: rabbitmq
version: 0.1.15
version: 0.1.16
home: https://github.com/rabbitmq/rabbitmq-server
...

View File

@ -94,4 +94,7 @@ if ! [ "${POD_INCREMENT}" -eq "0" ] && ! [ -d "/var/lib/rabbitmq/mnesia" ] ; the
rm -fv /tmp/rabbit-disable-readiness /tmp/rabbit-disable-liveness-probe
fi
{{- if .Values.forceBoot.enabled }}
if [ "${POD_INCREMENT}" -eq "0" ] && [ -d "/var/lib/rabbitmq/mnesia/${RABBITMQ_NODENAME}" ]; then rabbitmqctl force_boot; fi
{{- end}}
exec rabbitmq-server

View File

@ -46,6 +46,12 @@ images:
- dep_check
- image_repo_sync
# forceBoot: executes 'rabbitmqctl force_boot' to force boot on
# cluster shut down unexpectedly in an unknown order.
# ref: https://www.rabbitmq.com/rabbitmqctl.8.html#force_boot
forceBoot:
enabled: false
pod:
probes:
prometheus_rabbitmq_exporter:

View File

@ -15,4 +15,5 @@ rabbitmq:
- 0.1.13 Add prestop action and version 3.8.x upgrade prep
- 0.1.14 Update readiness and liveness probes
- 0.1.15 Update htk requirements
- 0.1.16 Add force_boot command to rabbit start template
...