Bug 1297862 - Ganesha hook script executes showmount and causes a hang
Ganesha hook script executes showmount and causes a hang
Status: CLOSED CURRENTRELEASE
Product: GlusterFS
Classification: Community
Component: ganesha-nfs (Show other bugs)
3.7.7
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Niels de Vos
: Triaged
Depends On: 1294446
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-12 11:27 EST by Niels de Vos
Modified: 2016-04-19 03:52 EDT (History)
1 user (show)

See Also:
Fixed In Version: glusterfs-3.7.7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1294446
Environment:
Last Closed: 2016-04-19 03:52:37 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Niels de Vos 2016-01-12 11:27:02 EST
+++ This bug was initially created as a clone of Bug #1294446 +++
+++                                                           +++
+++ Use this bug to backport the fix to release 3.7.          +++

Description of problem:
When rpcbind is not running on the server (or is firewalled), and a Gluster volume is started (after create or stop), a hook script calls 'showmount' and hangs.

Version-Release number of selected component (if applicable):
current master

How reproducible:
100%

Steps to Reproduce (from memory):
1. stop the rpcbind service (also rpcbind.sock on systemd based installations)
2. create a volume
3. set the 'ganesha.enable' volume option
4. start the volume

Actual results:
The 'gluster volume star ...' command hangs, 

Expected results:
No hang.

Additional info:
The cause seems to be the 'S31ganesha-start.sh' hook script. Instead of 'showmount', an equivalent dbus command could be used.

--- Additional comment from Vijay Bellur on 2015-12-28 10:40:26 CET ---

REVIEW: http://review.gluster.org/13098 (scripts: prevent running 'showmount' from the start/post hook script) posted (#1) for review on master by Niels de Vos (ndevos@redhat.com)

--- Additional comment from Niels de Vos on 2015-12-28 10:54:58 CET ---

(In reply to Niels de Vos from comment #0)
...
> Steps to Reproduce (from memory):
> 1. stop the rpcbind service (also rpcbind.sock on systemd based
> installations)
> 2. create a volume
> 3. set the 'ganesha.enable' volume option
> 4. start the volume

It does not seem to be required to set the 'ganesha.enable' volume option. The 'showmount' command that hangs, is executed before this option is checked.

--- Additional comment from Vijay Bellur on 2016-01-12 16:38:35 CET ---

COMMIT: http://review.gluster.org/13098 committed in master by Kaleb KEITHLEY (kkeithle@redhat.com) 
------
commit 2b2294d2a4ef221fccb6eb9f74e9b7dc233b9f1d
Author: Niels de Vos <ndevos@redhat.com>
Date:   Mon Dec 28 10:26:20 2015 +0100

    scripts: prevent running 'showmount' from the start/post hook script
    
    The 31ganesha-start.sh hook script tries to run 'showmount' to see if
    the volume that is getting started should get exported by NFS-Ganesha.
    It was reported that this caused the 'gluster volume start ...' command
    to hang in case rpcbind is not running.
    
    Instead of running 'showmount', we can use DBus to contact NFS-Ganesha
    directly, and request the available exports. This will immediately fail
    in case NFS-Ganesha is not running.
    
    BUG: 1294446
    Change-Id: I3aba1f86fead67116ca5adb1864a8be626c334fa
    Reported-by: Jeff Darcy <jdarcy@redhat.com>
    Signed-off-by: Niels de Vos <ndevos@redhat.com>
    Reviewed-on: http://review.gluster.org/13098
    Tested-by: Raghavendra Talur <rtalur@redhat.com>
    Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
    Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Comment 1 Vijay Bellur 2016-01-12 11:36:13 EST
REVIEW: http://review.gluster.org/13230 (scripts: prevent running 'showmount' from the start/post hook script) posted (#1) for review on release-3.7 by Niels de Vos (ndevos@redhat.com)
Comment 2 Vijay Bellur 2016-01-14 06:34:50 EST
COMMIT: http://review.gluster.org/13230 committed in release-3.7 by Kaleb KEITHLEY (kkeithle@redhat.com) 
------
commit 8dcc5596c5370fcbee6ac8fc89cc90ff1d5fd29a
Author: Niels de Vos <ndevos@redhat.com>
Date:   Tue Jan 12 17:35:34 2016 +0100

    scripts: prevent running 'showmount' from the start/post hook script
    
    The 31ganesha-start.sh hook script tries to run 'showmount' to see if
    the volume that is getting started should get exported by NFS-Ganesha.
    It was reported that this caused the 'gluster volume start ...' command
    to hang in case rpcbind is not running.
    
    Instead of running 'showmount', we can use DBus to contact NFS-Ganesha
    directly, and request the available exports. This will immediately fail
    in case NFS-Ganesha is not running.
    
    Cherry picked from commit 2b2294d2a4ef221fccb6eb9f74e9b7dc233b9f1d:
    > BUG: 1294446
    > Change-Id: I3aba1f86fead67116ca5adb1864a8be626c334fa
    > Reported-by: Jeff Darcy <jdarcy@redhat.com>
    > Signed-off-by: Niels de Vos <ndevos@redhat.com>
    > Reviewed-on: http://review.gluster.org/13098
    > Tested-by: Raghavendra Talur <rtalur@redhat.com>
    > Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
    > Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
    
    BUG: 1297862
    Change-Id: I3aba1f86fead67116ca5adb1864a8be626c334fa
    Signed-off-by: Niels de Vos <ndevos@redhat.com>
    Reviewed-on: http://review.gluster.org/13230
    Tested-by: NetBSD Build System <jenkins@build.gluster.org>
    Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Comment 3 Kaushal 2016-04-19 03:52:37 EDT
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.7, please open a new bug report.

glusterfs-3.7.7 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] https://www.gluster.org/pipermail/gluster-users/2016-February/025292.html
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Note You need to log in before you can comment on or make changes to this bug.