summaryrefslogtreecommitdiffstats
path: root/extras/ganesha/ocf/ganesha_mon
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2015-05-07 09:22:04 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-06-01 11:13:45 -0700
commit751c4583bbaa59ebfe492ab6ecfab3108711f4c5 (patch)
tree25b770eeb1341f42c57b3f1d0b96707f45cce0ec /extras/ganesha/ocf/ganesha_mon
parent3f11b8e8ec6d78ebe33636b64130d5d133729f2c (diff)
common-ha: fix race between setting grace and virt IP fail-over
Also send stderr output of `pcs resource {create,delete} $node-dead_ip-1` to /dev/null to avoid flooding the logs Change-Id: I29d526429cc4d7521971cd5e2e69bfb64bfc5ca9 BUG: 1219485 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/10646 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: soumya k <skoduri@redhat.com> Reviewed-by: Meghana M <mmadhusu@redhat.com>
Diffstat (limited to 'extras/ganesha/ocf/ganesha_mon')
-rw-r--r--extras/ganesha/ocf/ganesha_mon24
1 files changed, 14 insertions, 10 deletions
diff --git a/extras/ganesha/ocf/ganesha_mon b/extras/ganesha/ocf/ganesha_mon
index 6ba7178235b..47943f8a577 100644
--- a/extras/ganesha/ocf/ganesha_mon
+++ b/extras/ganesha/ocf/ganesha_mon
@@ -36,6 +36,8 @@ else
. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
fi
+GRACE_DELAY=7
+
ganesha_meta_data() {
cat <<END
<?xml version="1.0"?>
@@ -98,13 +100,7 @@ ganesha_mon_monitor()
if [ -e /var/run/ganesha.nfsd.pid -a \
-d /proc/$(cat /var/run/ganesha.nfsd.pid) ]; then
- # logger "note: ganesha_mon_monitor() pcs resource delete ${short_host}-dead_ip-1"
- pcs resource delete ${short_host}-dead_ip-1
- # if [ $? -ne 0 ]; then
- # logger "warning: pcs resource delete ${short_host}-dead_ip-1"
- # fi
-
- sleep 1
+ ( pcs resource delete ${short_host}-dead_ip-1 > /dev/null 2>&1 )
attrd_updater -n ganesha-active -v 1
if [ $? -ne 0 ]; then
@@ -112,13 +108,21 @@ ganesha_mon_monitor()
fi
else
- # logger "note: ganesha_mon_montor(), pcs resource create ${short_host}-dead_ip-1 ocf:heartbeat:Dummy"
- pcs resource create ${short_host}-dead_ip-1 ocf:heartbeat:Dummy
+ ( pcs resource create ${short_host}-dead_ip-1 ocf:heartbeat:Dummy > /dev/null 2>&1 )
if [ $? -ne 0 ]; then
logger "warning: pcs resource create ${short_host}-dead_ip-1 ocf:heartbeat:Dummy failed"
fi
- sleep 1
+ # The ${this-node}-dead_ip-1 resource is used to indicate
+ # that this ganesha.nfsd has died.
+ # VIP fail-over is then triggered by clearing the
+ # ganesha-active node attribute on this node.
+ #
+ # Meanwhile the ganesha_grace monitor() runs every 5
+ # seconds. We need to allow time for it to run and put
+ # the remaining ganesha.nfsds into grace before initiating
+ # the VIP fail-over.
+ sleep ${GRACE_DELAY}
attrd_updater -D -n ganesha-active
if [ $? -ne 0 ]; then