Blob Blame History Raw
From 3463bc5b3e10aa59550b952637c92a189d08678d Mon Sep 17 00:00:00 2001
From: Soumya Koduri <skoduri@redhat.com>
Date: Mon, 3 Oct 2016 12:35:39 +0530
Subject: [PATCH 347/361] common-ha: Use UpdateExports dbus msg for
 refresh-config

In nfs-ganesha 2.4, new dbs msg type "UpdateExports" support
has been added. With this support, the exports can be re-configured
dynamically without the need to re-export the entries.

mainline:
> BUG: 1382258
> Reviewed-on: http://review.gluster.org/15617
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
(cherry picked from commit 7ba55f9386810878da7075b742b02134f9cbb484)

BUG: 1370027
Change-Id: Iee7330d33e91db1126974a2ff46becb3764f2e5e
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/101283
Tested-by: Milind Changire <mchangir@redhat.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
---
 extras/ganesha/scripts/ganesha-ha.sh | 26 ++------------------------
 glusterfs.spec.in                    |  3 ++-
 2 files changed, 4 insertions(+), 25 deletions(-)

diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
index 8f138ef..c145805 100644
--- a/extras/ganesha/scripts/ganesha-ha.sh
+++ b/extras/ganesha/scripts/ganesha-ha.sh
@@ -261,19 +261,7 @@ refresh_config ()
                 output=$(ssh -oPasswordAuthentication=no \
 -oStrictHostKeyChecking=no -i ${SECRET_PEM} root@${current_host} \
 "dbus-send --print-reply --system --dest=org.ganesha.nfsd \
-/org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.RemoveExport \
-uint16:$export_id 2>&1")
-                ret=$?
-                logger <<< "${output}"
-                if [ ${ret} -ne 0 ]; then
-                       echo "Error: refresh-config failed on ${current_host}."
-                       exit 1
-                fi
-                sleep 1
-                output=$(ssh -oPasswordAuthentication=no \
--oStrictHostKeyChecking=no -i ${SECRET_PEM} root@${current_host} \
-"dbus-send --print-reply --system --dest=org.ganesha.nfsd \
-/org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport \
+/org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport \
 string:$HA_CONFDIR/exports/export.$VOL.conf \
 string:\"EXPORT(Export_Id=$export_id)\" 2>&1")
                 ret=$?
@@ -295,17 +283,7 @@ string:\"EXPORT(Export_Id=$export_id)\" 2>&1")
 
     # Run the same command on the localhost,
         output=$(dbus-send --print-reply --system --dest=org.ganesha.nfsd \
-/org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.RemoveExport \
-uint16:$export_id 2>&1)
-        ret=$?
-        logger <<< "${output}"
-        if [ ${ret} -ne 0 ]; then
-                echo "Error: refresh-config failed on localhost."
-                exit 1
-        fi
-        sleep 1
-        output=$(dbus-send --print-reply --system --dest=org.ganesha.nfsd \
-/org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport \
+/org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport \
 string:$HA_CONFDIR/exports/export.$VOL.conf \
 string:"EXPORT(Export_Id=$export_id)" 2>&1)
         ret=$?
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index a4f4f95..c313d2f 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -396,7 +396,8 @@ Summary:          NFS-Ganesha configuration
 Group:            Applications/File
 
 Requires:         %{name}-server%{?_isa} = %{version}-%{release}
-Requires:         nfs-ganesha-gluster, pcs, dbus
+Requires:         nfs-ganesha-gluster >= 2.4.0
+Requires:         pcs, dbus
 %if ( 0%{?rhel} && 0%{?rhel} == 6 )
 Requires:         cman, pacemaker, corosync
 %endif
-- 
1.8.3.1