From f784e8cb080c453bc9c1cafa447fb125da652761 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 31 2016 11:52:48 +0000 Subject: import resource-agents-3.9.5-54.el7_2.8 --- diff --git a/SOURCES/bz1311180-rabbitmq-cluster-forget-stopped-cluster-nodes.patch b/SOURCES/bz1311180-rabbitmq-cluster-forget-stopped-cluster-nodes.patch new file mode 100644 index 0000000..585b8b3 --- /dev/null +++ b/SOURCES/bz1311180-rabbitmq-cluster-forget-stopped-cluster-nodes.patch @@ -0,0 +1,92 @@ +diff -uNr a/heartbeat/rabbitmq-cluster b/heartbeat/rabbitmq-cluster +--- a/heartbeat/rabbitmq-cluster 2016-02-22 11:09:48.989128414 +0100 ++++ b/heartbeat/rabbitmq-cluster 2016-02-22 11:10:12.011835745 +0100 +@@ -39,7 +39,14 @@ + RMQ_LOG_DIR="/var/log/rabbitmq" + NODENAME=$(ocf_local_nodename) + ++# this attr represents the current active local rmq node name. ++# when rmq stops or the node is fenced, this attr disappears + RMQ_CRM_ATTR_COOKIE="rmq-node-attr-${OCF_RESOURCE_INSTANCE}" ++# this attr represents the last known active local rmq node name ++# when rmp stops or the node is fenced, the attr stays forever so ++# we can continue to map an offline pcmk node to it's rmq node name ++# equivalent. ++RMQ_CRM_ATTR_COOKIE_LAST_KNOWN="rmq-node-attr-last-known-${OCF_RESOURCE_INSTANCE}" + + meta_data() { + cat < +Date: Mon, 29 Feb 2016 12:46:50 +0100 +Subject: [PATCH] Backup and restore rabbitmq users during resource restart + +Signed-off-by: Peter Lemenkov + +diff --git a/heartbeat/rabbitmq-cluster b/heartbeat/rabbitmq-cluster +index cc45f09..4545495 100755 +--- a/heartbeat/rabbitmq-cluster ++++ b/heartbeat/rabbitmq-cluster +@@ -289,7 +289,19 @@ rmq_start() { + rmq_stop + rmq_wipe_data + rmq_join_existing "$join_list" +- if [ $? -ne 0 ]; then ++ rc=$? ++ ++ # Restore users (if any) ++ BaseDataDir=`dirname $RMQ_DATA_DIR` ++ if [ -f $BaseDataDir/users.erl ] ; then ++ rabbitmqctl eval " ++ {ok, [Users]} = file:consult(\"$BaseDataDir/users.erl\"), ++ lists:foreach(fun(X) -> mnesia:dirty_write(rabbit_user, X) end, Users). ++ " ++ rm -f $BaseDataDir/users.erl ++ fi ++ ++ if [ $rc -ne 0 ]; then + ocf_log info "node failed to join even after reseting local data. Check SELINUX policy" + return $OCF_ERR_GENERIC + fi +@@ -299,6 +311,13 @@ rmq_start() { + } + + rmq_stop() { ++ # Backup users ++ BaseDataDir=`dirname $RMQ_DATA_DIR` ++ rabbitmqctl eval " ++ Users = mnesia:dirty_select(rabbit_user, [{ {internal_user, '\\\$1', '_', '_'}, [{'/=', '\\\$1', <<\"guest\">>}], ['\\\$_'] } ]), ++ file:write_file(\"$BaseDataDir/users.erl\", io_lib:fwrite(\"~p.~n\", [Users])). ++ " ++ + rmq_monitor + if [ $? -eq $OCF_NOT_RUNNING ]; then + return $OCF_SUCCESS diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec index 9d44a9e..d5d9477 100644 --- a/SPECS/resource-agents.spec +++ b/SPECS/resource-agents.spec @@ -32,7 +32,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 3.9.5 -Release: 54%{?dist}.6 +Release: 54%{?dist}.8 License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents %if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} @@ -131,6 +131,8 @@ Patch86: bz1304019-novaevacuate-invoke-off-action.patch Patch87: bz1304370-nfsserver-fix-systemd-status-detection.patch Patch88: bz1304711-galera-custom-host-port.patch Patch89: bz1304811-replace-novacompute-with-nova-compute-wait.patch +Patch90: bz1311180-rabbitmq-cluster-forget-stopped-cluster-nodes.patch +Patch91: bz1316633-backup-and-restore-rabbitmq-users-during-resource-re.patch Obsoletes: heartbeat-resources <= %{version} Provides: heartbeat-resources = %{version} @@ -325,6 +327,8 @@ exit 1 %patch87 -p1 %patch88 -p1 %patch89 -p1 +%patch90 -p1 +%patch91 -p1 %build if [ ! -f configure ]; then @@ -577,6 +581,16 @@ ccs_update_schema > /dev/null 2>&1 ||: %endif %changelog +* Fri Mar 11 2016 Oyvind Albrigtsen - 3.9.5-54.8 +- rabbitmq-cluster: keep users during resource reload + + Resolves: rhbz#1316633 + +* Tue Feb 23 2016 Oyvind Albrigtsen - 3.9.5-54.7 +- rabbitmq-cluster: fix to forget stopped cluster nodes + + Resolves: rhbz#1311180 + * Fri Feb 5 2016 Oyvind Albrigtsen - 3.9.5-54.6 - nfsserver: fix systemd status detection - Replace NovaCompute with nova-compute-wait which lets systemd