Blame SOURCES/dont-use-ocf_attribute_target-for-metadata.patch

b4b3ce
From 2dbfbd8ee3c1547f941507ab4109aa04eec0ef5a Mon Sep 17 00:00:00 2001
b4b3ce
From: Michele Baldessari <michele@acksyn.org>
b4b3ce
Date: Mon, 16 Jul 2018 20:24:04 +0200
b4b3ce
Subject: [PATCH] Do not call ocf_attribute_target in the meta-data function
b4b3ce
b4b3ce
Starting with pacemaker-1.1.19 a "crm_node -n" call triggers
b4b3ce
a CRM_OP_NODE_INFO cluster operation. If this is called
b4b3ce
from a bundle with 1.1.19 code (or later) running on a 1.1.18
b4b3ce
cluster, during a meta-data call we will get the following error in the
b4b3ce
cluster logs:
b4b3ce
Jul 14 11:35:27 [20041] controller-0 crmd: error: handle_request: Unexpected request (node-info) sent to non-DC node
b4b3ce
Jul 14 11:35:27 [20041] controller-0 crmd: error: handle_request: Unexpected <create_request_adv origin="send_node_info_request" t="crmd" version="3.0.14" subt="request" reference="node-info-crm_node-1531568127-1" crm_task="node-info" crm_sys_to="crmd" crm_sys_from="e67698a2-6f50-45fc-b8de-423c94e11c99" acl_target="root" crm_user="root" src="controller-0"/>
b4b3ce
b4b3ce
By not calling ocf_attribute_target (which triggers a crm_node -n
b4b3ce
call) when polling for meta-data we do not run into this issue.
b4b3ce
b4b3ce
This can easily get triggered when creating a resource invoking
b4b3ce
crm_node -n inside a 1.1.19 container with pcs, as that invokes
b4b3ce
the 'meta-data' action explicitely.
b4b3ce
b4b3ce
Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com>
b4b3ce
Suggested-By: Ken Gaillot <kgaillot@redhat.com>
b4b3ce
---
b4b3ce
 heartbeat/galera           | 6 ++++--
b4b3ce
 heartbeat/rabbitmq-cluster | 4 +++-
b4b3ce
 heartbeat/redis.in         | 4 +++-
b4b3ce
 3 files changed, 10 insertions(+), 4 deletions(-)
b4b3ce
b4b3ce
diff --git a/heartbeat/galera b/heartbeat/galera
b4b3ce
index 270bdaf1b..4f341ceef 100755
b4b3ce
--- a/heartbeat/galera
b4b3ce
+++ b/heartbeat/galera
b4b3ce
@@ -66,9 +66,11 @@
b4b3ce
 
b4b3ce
 : ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
b4b3ce
 . ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
b4b3ce
-. ${OCF_FUNCTIONS_DIR}/mysql-common.sh
b4b3ce
 
b4b3ce
-NODENAME=$(ocf_attribute_target)
b4b3ce
+if [ "$__OCF_ACTION" != "meta-data" ]; then
b4b3ce
+    . ${OCF_FUNCTIONS_DIR}/mysql-common.sh
b4b3ce
+    NODENAME=$(ocf_attribute_target)
b4b3ce
+fi
b4b3ce
 
b4b3ce
 # It is common for some galera instances to store
b4b3ce
 # check user that can be used to query status
b4b3ce
diff --git a/heartbeat/rabbitmq-cluster b/heartbeat/rabbitmq-cluster
b4b3ce
index 9ff49e075..54a16c941 100755
b4b3ce
--- a/heartbeat/rabbitmq-cluster
b4b3ce
+++ b/heartbeat/rabbitmq-cluster
b4b3ce
@@ -37,7 +37,9 @@ RMQ_DATA_DIR="/var/lib/rabbitmq/mnesia"
b4b3ce
 RMQ_PID_DIR="/var/run/rabbitmq"
b4b3ce
 RMQ_PID_FILE="/var/run/rabbitmq/rmq.pid"
b4b3ce
 RMQ_LOG_DIR="/var/log/rabbitmq"
b4b3ce
-NODENAME=$(ocf_attribute_target)
b4b3ce
+if [ "$__OCF_ACTION" != "meta-data" ]; then
b4b3ce
+	NODENAME=$(ocf_attribute_target)
b4b3ce
+fi
b4b3ce
 
b4b3ce
 # this attr represents the current active local rmq node name.
b4b3ce
 # when rmq stops or the node is fenced, this attr disappears
b4b3ce
diff --git a/heartbeat/redis.in b/heartbeat/redis.in
b4b3ce
index d5eb8f664..ddc62d8a7 100644
b4b3ce
--- a/heartbeat/redis.in
b4b3ce
+++ b/heartbeat/redis.in
b4b3ce
@@ -664,7 +664,9 @@ redis_validate() {
b4b3ce
 	fi
b4b3ce
 }
b4b3ce
 
b4b3ce
-NODENAME=$(ocf_attribute_target)
b4b3ce
+if [ "$__OCF_ACTION" != "meta-data" ]; then
b4b3ce
+	NODENAME=$(ocf_attribute_target)
b4b3ce
+fi
b4b3ce
 if [ -r "$REDIS_CONFIG" ]; then
b4b3ce
 	clientpasswd="$(sed -n -e  's/^\s*requirepass\s*\(.*\)\s*$/\1/p' < $REDIS_CONFIG | tail -n 1)"
b4b3ce
 fi