From 4c262454d538e57f8c86d0e4defad759605b870a Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Thu, 7 May 2015 09:22:04 -0400 Subject: 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 > backport of http://review.gluster.org/#/c/10646/, BZ 1219485 Change-Id: I29d526429cc4d7521971cd5e2e69bfb64bfc5ca9 BUG: 1227028 Signed-off-by: Kaleb S. KEITHLEY Reviewed-on: http://review.gluster.org/10646 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: soumya k Reviewed-by: Meghana M Reviewed-on: http://review.gluster.org/11036 --- extras/ganesha/ocf/ganesha_mon | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'extras') 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 < @@ -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 -- cgit