21ab4e
From 3463bc5b3e10aa59550b952637c92a189d08678d Mon Sep 17 00:00:00 2001
21ab4e
From: Soumya Koduri <skoduri@redhat.com>
21ab4e
Date: Mon, 3 Oct 2016 12:35:39 +0530
21ab4e
Subject: [PATCH 347/361] common-ha: Use UpdateExports dbus msg for
21ab4e
 refresh-config
21ab4e
21ab4e
In nfs-ganesha 2.4, new dbs msg type "UpdateExports" support
21ab4e
has been added. With this support, the exports can be re-configured
21ab4e
dynamically without the need to re-export the entries.
21ab4e
21ab4e
mainline:
21ab4e
> BUG: 1382258
21ab4e
> Reviewed-on: http://review.gluster.org/15617
21ab4e
> Smoke: Gluster Build System <jenkins@build.gluster.org>
21ab4e
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
21ab4e
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
21ab4e
> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
21ab4e
(cherry picked from commit 7ba55f9386810878da7075b742b02134f9cbb484)
21ab4e
21ab4e
BUG: 1370027
21ab4e
Change-Id: Iee7330d33e91db1126974a2ff46becb3764f2e5e
21ab4e
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
21ab4e
Reviewed-on: https://code.engineering.redhat.com/gerrit/101283
21ab4e
Tested-by: Milind Changire <mchangir@redhat.com>
21ab4e
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
21ab4e
---
21ab4e
 extras/ganesha/scripts/ganesha-ha.sh | 26 ++------------------------
21ab4e
 glusterfs.spec.in                    |  3 ++-
21ab4e
 2 files changed, 4 insertions(+), 25 deletions(-)
21ab4e
21ab4e
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
21ab4e
index 8f138ef..c145805 100644
21ab4e
--- a/extras/ganesha/scripts/ganesha-ha.sh
21ab4e
+++ b/extras/ganesha/scripts/ganesha-ha.sh
21ab4e
@@ -261,19 +261,7 @@ refresh_config ()
21ab4e
                 output=$(ssh -oPasswordAuthentication=no \
21ab4e
 -oStrictHostKeyChecking=no -i ${SECRET_PEM} root@${current_host} \
21ab4e
 "dbus-send --print-reply --system --dest=org.ganesha.nfsd \
21ab4e
-/org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.RemoveExport \
21ab4e
-uint16:$export_id 2>&1")
21ab4e
-                ret=$?
21ab4e
-                logger <<< "${output}"
21ab4e
-                if [ ${ret} -ne 0 ]; then
21ab4e
-                       echo "Error: refresh-config failed on ${current_host}."
21ab4e
-                       exit 1
21ab4e
-                fi
21ab4e
-                sleep 1
21ab4e
-                output=$(ssh -oPasswordAuthentication=no \
21ab4e
--oStrictHostKeyChecking=no -i ${SECRET_PEM} root@${current_host} \
21ab4e
-"dbus-send --print-reply --system --dest=org.ganesha.nfsd \
21ab4e
-/org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport \
21ab4e
+/org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport \
21ab4e
 string:$HA_CONFDIR/exports/export.$VOL.conf \
21ab4e
 string:\"EXPORT(Export_Id=$export_id)\" 2>&1")
21ab4e
                 ret=$?
21ab4e
@@ -295,17 +283,7 @@ string:\"EXPORT(Export_Id=$export_id)\" 2>&1")
21ab4e
 
21ab4e
     # Run the same command on the localhost,
21ab4e
         output=$(dbus-send --print-reply --system --dest=org.ganesha.nfsd \
21ab4e
-/org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.RemoveExport \
21ab4e
-uint16:$export_id 2>&1)
21ab4e
-        ret=$?
21ab4e
-        logger <<< "${output}"
21ab4e
-        if [ ${ret} -ne 0 ]; then
21ab4e
-                echo "Error: refresh-config failed on localhost."
21ab4e
-                exit 1
21ab4e
-        fi
21ab4e
-        sleep 1
21ab4e
-        output=$(dbus-send --print-reply --system --dest=org.ganesha.nfsd \
21ab4e
-/org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport \
21ab4e
+/org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport \
21ab4e
 string:$HA_CONFDIR/exports/export.$VOL.conf \
21ab4e
 string:"EXPORT(Export_Id=$export_id)" 2>&1)
21ab4e
         ret=$?
21ab4e
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
21ab4e
index a4f4f95..c313d2f 100644
21ab4e
--- a/glusterfs.spec.in
21ab4e
+++ b/glusterfs.spec.in
21ab4e
@@ -396,7 +396,8 @@ Summary:          NFS-Ganesha configuration
21ab4e
 Group:            Applications/File
21ab4e
 
21ab4e
 Requires:         %{name}-server%{?_isa} = %{version}-%{release}
21ab4e
-Requires:         nfs-ganesha-gluster, pcs, dbus
21ab4e
+Requires:         nfs-ganesha-gluster >= 2.4.0
21ab4e
+Requires:         pcs, dbus
21ab4e
 %if ( 0%{?rhel} && 0%{?rhel} == 6 )
21ab4e
 Requires:         cman, pacemaker, corosync
21ab4e
 %endif
21ab4e
-- 
21ab4e
1.8.3.1
21ab4e