Bug 1282915 - glusterfs does not register with rpcbind on restart
glusterfs does not register with rpcbind on restart
Status: CLOSED CURRENTRELEASE
Product: GlusterFS
Classification: Community
Component: packaging (Show other bugs)
mainline
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Kaushal
: ZStream
Depends On:
Blocks: 1283142 1283144 1283542 1285958
  Show dependency treegraph
 
Reported: 2015-11-17 14:29 EST by Mike
Modified: 2017-02-25 10:31 EST (History)
5 users (show)

See Also:
Fixed In Version: glusterfs-3.8rc2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1283142 1283144 1283542 1285958 (view as bug list)
Environment:
Last Closed: 2016-06-16 09:44:42 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 Mike 2015-11-17 14:29:37 EST
Description of problem: Gluster does not reload gracefully upon server restart


Version-Release number of selected component (if applicable):
3.2+

How reproducible:
     

Steps to Reproduce:
1. Install GlusterFS as per docs on Centos7.
2. Create and start volume.
3. Restart server.

Actual results:
rpcbind service will not be active.

Expected results:
gluster will have registered with rpcbind

Additional info:

/usr/lib/systemd/system/glusterd.service has the following:
"[Unit]
Description=GlusterFS, a clustered file-system server
After=network.target rpcbind.service
Before=network-online.target"

Changing to:
[Unit]
Description=GlusterFS, a clustered file-system server
Requires=rpcbind.service
After=network.target 
Before=network-online.target

Corrects the issue.
Comment 2 Kaushal 2015-11-18 00:55:39 EST
Thanks for reporting this. Turns out we've misunderstood the meaning of the `After` option.

According to the systemd.unit(5) man page, the `After` option only sets up ordering. If unit foo.service has the option `After=bar.service`, the option only ensures that if both foo and bar are started together, foo is started after bar. It doesn't ensure that starting only foo starts bar.

The `Requires` option only sets up the requirement, but doesn't set up ordering. If foo.service `Requires` bar.service, it is only guaranteed that starting foo will also start bar, but not necessarily in order.

The man page suggests that if a unit requires that another unit be started before itself, then both `After` and `Requires` must be used.

I've submitted a change for review that fixes this at http://review.gluster.org/12605
Comment 3 Vijay Bellur 2015-11-18 05:21:10 EST
COMMIT: http://review.gluster.org/12605 committed in master by Atin Mukherjee (amukherj@redhat.com) 
------
commit 23440a73bc348bbc3bb43ec397f0639ee45865fc
Author: Kaushal M <kaushal@redhat.com>
Date:   Wed Nov 18 11:21:13 2015 +0530

    glusterd.service: Ensure rpcbind is started before glusterd
    
    Having the rpcbind.service under the `After` option only ensures that
    glusterd.service is started after rpcbind.service if both are
    enabled/started at the same time. It doesn't ensure that starting
    glusterd.service will start rpcbind.service.
    
    The systemd.unit(5) man page suggests to use both the `Requires` and
    `After` options to ensure that rpcbind is started before glusterd,
    whenever glusterd is started.
    
    BUG: 1282915
    Change-Id: Iee69965486be08711299aba235f7b00c3e2fe7e9
    Signed-off-by: Kaushal M <kaushal@redhat.com>
    Reviewed-on: http://review.gluster.org/12605
    Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
    Reviewed-by: Anand Nekkunti <anekkunt@redhat.com>
    Tested-by: Gluster Build System <jenkins@build.gluster.com>
    Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Comment 4 Niels de Vos 2016-06-16 09:44:42 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.8.0, please open a new bug report.

glusterfs-3.8.0 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] http://blog.gluster.org/2016/06/glusterfs-3-8-released/
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user
Comment 5 nh2 2017-02-25 10:31:30 EST
I believe that adding `Requires=` here was the wrong (or at least not optimal) solution; `systemctl enable rpcbind` should have been used instead.

See https://bugzilla.redhat.com/show_bug.cgi?id=1426842 for details.

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