Blob Blame History Raw
From 5603f1925db1085aedd8c0c1fa83d393ed2f9700 Mon Sep 17 00:00:00 2001
From: Kaleb S KEITHLEY <kkeithle@redhat.com>
Date: Tue, 24 May 2016 06:46:40 -0400
Subject: [PATCH 171/178] common-ha: post fail-back, ganesha.nfsds are not put into NFS-GRACE

A little known, rarely used feature of pacemaker called
"notification" is used to follow the status of the ganesha.nfsds
in the cluster. This is done with location constraints and other
Black Magick.

When a nfsd dies, the ganesha-active attribute is cleared, the
associated floating IP (VIP) fails over to another node, and the
ganesha_grace notify method is invoked with post-stop on all the
nodes where the ganesha.nfsd is still running. The notify methods
send dbus msgs to put their nfsds into NFS-GRACE, and the nfsds
perform their grace processing, e.g. taking over locks from the
failed nfsd.

N.B. Fail-back was originally not planned to be a feature for
glusterfs-3.7, but we sorta got it for free.

For fail-back, the opposite occurs. The ganesha-active attribute
is recreated, the floating IP fails back, and the notify method is
invoked with pre-start on all the nodes where the surviving
ganesha.nfsds continue to run. The notify methods send dbus msgs
again to put their nsfds into NFS-GRACE again, and the nfsds clean
up their locks.

backport mainline
> Change-Id: I3fc64afa20ae3a928143d69aa533a8df68dd680e
> http://review.gluster.org/14506
> BUG: 1338967
release-3.8
> http://review.gluster.org/14507
> BUG: 1338968
release-3.7
> http://review.gluster.org/#/c/14508/
> BUG: 1338969

Change-Id: I4a0b21d74eaec435adb1b8334a45b3482384ddfc
BUG: 1339090
Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/75017
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
---
 extras/ganesha/ocf/ganesha_grace |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/extras/ganesha/ocf/ganesha_grace b/extras/ganesha/ocf/ganesha_grace
index dc4d657..21b95dd 100644
--- a/extras/ganesha/ocf/ganesha_grace
+++ b/extras/ganesha/ocf/ganesha_grace
@@ -142,10 +142,11 @@ ganesha_grace_stop()
 
 ganesha_grace_notify()
 {
+        # since this is a clone RA we should only ever see pre-start
+        # or post-stop
 	mode="${OCF_RESKEY_CRM_meta_notify_type}-${OCF_RESKEY_CRM_meta_notify_operation}"
-	case "$mode" in
-	post-stop)
-		ocf_log debug "stop_uname:${OCF_RESKEY_CRM_meta_notify_stop_uname}"
+	case "${mode}" in
+	pre-start | post-stop)
 		dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/admin org.ganesha.nfsd.admin.grace string:${OCF_RESKEY_CRM_meta_notify_stop_uname}
 		if [ $? -ne 0 ]; then
 			ocf_log info "dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/admin org.ganesha.nfsd.admin.grace string:${OCF_RESKEY_CRM_meta_notify_stop_uname} failed"
-- 
1.7.1