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>
This commit is contained in:
parent
3f11b8e8ec
commit
751c4583bb
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user