summaryrefslogtreecommitdiffstats
path: root/extras/ganesha/ocf/ganesha_mon
diff options
context:
space:
mode:
authorKaleb S KEITHLEY <kkeithle@redhat.com>2016-04-06 11:18:30 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-04-28 03:19:50 -0700
commit6530521700d94834d110424f525b95e40bf68094 (patch)
treed42acf6cdd099063624541a360ff3234e6d44a86 /extras/ganesha/ocf/ganesha_mon
parent3af9b53d13a88b93d026d599c9f86f8bb1845b6c (diff)
common-ha: continuous grace_mon log messages in /var/log/messages
messages are seen on RHEL6.x and RHEL7.1 and earlier versions of pacemaker. (And RHEL7.2 with RHEL7.1 pacemaker packages.) It's not possible to query attrd attributes in the older version, only set/update/clear them. The messages come from invalid attempts to query the attributes. However it is possible to query crm attributes. The fix here is to create a "shadow" crm attribute for the attrd attribute. Changes are made to both, queries are made on the crm attribute. (Resource Agents "follow" the attrd attribute using constraint locations, so we must keep the attrd attribute.) Change-Id: I84ac1a80673e528d98b67b7d5062e21dcf744d4a BUG: 1324509 Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/13919 Reviewed-by: Niels de Vos <ndevos@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: soumya k <skoduri@redhat.com>
Diffstat (limited to 'extras/ganesha/ocf/ganesha_mon')
-rw-r--r--extras/ganesha/ocf/ganesha_mon39
1 files changed, 25 insertions, 14 deletions
diff --git a/extras/ganesha/ocf/ganesha_mon b/extras/ganesha/ocf/ganesha_mon
index f55cf7f2af3..65450b82209 100644
--- a/extras/ganesha/ocf/ganesha_mon
+++ b/extras/ganesha/ocf/ganesha_mon
@@ -30,10 +30,10 @@
. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
if [ -n "${OCF_DEBUG_LIBRARY}" ]; then
- . ${OCF_DEBUG_LIBRARY}
+ . ${OCF_DEBUG_LIBRARY}
else
- : ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
-. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
+ : ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
+ . ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
fi
# Defaults
@@ -46,7 +46,7 @@ OCF_RESKEY_grace_delay_default="5"
: ${OCF_RESKEY_grace_delay=${OCF_RESKEY_grace_delay_default}}
ganesha_meta_data() {
- cat <<END
+ cat <<END
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="ganesha_mon">
@@ -113,13 +113,13 @@ ganesha_mon_start()
{
ocf_log debug "ganesha_mon_start"
ganesha_mon_monitor
- return $OCF_SUCCESS
+ return $OCF_SUCCESS
}
ganesha_mon_stop()
{
ocf_log debug "ganesha_mon_stop"
- return $OCF_SUCCESS
+ return $OCF_SUCCESS
}
ganesha_mon_monitor()
@@ -142,11 +142,22 @@ ganesha_mon_monitor()
ocf_log info "warning: attrd_updater -n ${OCF_RESKEY_ganesha_active} -v 1 failed"
fi
+ # ganesha_grace (nfs-grace) RA follows grace-active attr
+ # w/ constraint location
attrd_updater -n ${OCF_RESKEY_grace_active} -v 1
if [ $? -ne 0 ]; then
ocf_log info "warning: attrd_updater -n ${OCF_RESKEY_grace_active} -v 1 failed"
fi
+ # ganesha_mon (nfs-mon) and ganesha_grace (nfs-grace)
+ # track grace-active crm_attr (attr != crm_attr)
+ # we can't just use the attr as there's no way to query
+ # its value in RHEL6 pacemaker
+ crm_attribute --node=${short_host} --lifetime=forever --name=${OCF_RESKEY_grace_active} --update=1
+ if [ $? -ne 0 ]; then
+ ocf_log info "warning: crm_attribute --node=${short_host} --lifetime=forever --name=${OCF_RESKEY_grace_active} --update=1 failed"
+ fi
+
return ${OCF_SUCCESS}
fi
@@ -155,23 +166,23 @@ ganesha_mon_monitor()
#
# Meanwhile the ganesha_grace notify() runs when its
# nfs-grace resource is disabled on a node; which
- # is triggered by clearing the ganesha-grace node
- # attribute on this node.
+ # is triggered by clearing the grace-active attribute
+ # on this node.
#
# We need to allow time for it to run and put
# the remaining ganesha.nfsds into grace before
# initiating the VIP fail-over.
+ sleep ${OCF_RESKEY_grace_delay}
+
attrd_updater -D -n ${OCF_RESKEY_grace_active}
if [ $? -ne 0 ]; then
ocf_log info "warning: attrd_updater -D -n ${OCF_RESKEY_grace_active} failed"
fi
- sleep ${OCF_RESKEY_grace_delay}
-
- attrd_updater -D -n ${OCF_RESKEY_ganesha_active}
+ crm_attribute --node=${short_host} --name=${OCF_RESKEY_grace_active} --update=0
if [ $? -ne 0 ]; then
- ocf_log info "warning: attrd_updater -D -n ${OCF_RESKEY_ganesha_active} failed"
+ ocf_log info "warning: crm_attribute --node=${short_host} --name=${OCF_RESKEY_grace_active} --update=0 failed"
fi
return ${OCF_SUCCESS}
@@ -193,8 +204,8 @@ stop) ganesha_mon_stop
status|monitor) ganesha_mon_monitor
;;
*) ganesha_mon_usage
- exit ${OCF_ERR_UNIMPLEMENTED}
- ;;
+ exit ${OCF_ERR_UNIMPLEMENTED}
+ ;;
esac
rc=$?