Bug 1282915

Summary: glusterfs does not register with rpcbind on restart
Product: [Community] GlusterFS Reporter: Mike <devops>
Component: packagingAssignee: Kaushal <kaushal>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: amukherj, kaushal, nh2-redhatbugzilla, nlevinki, vbellur
Target Milestone: ---Keywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 13:44:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1283142, 1283144, 1283542, 1285958    

Description Mike 2015-11-17 19:29:37 UTC
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 05:55:39 UTC
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 10:21:10 UTC
COMMIT: http://review.gluster.org/12605 committed in master by Atin Mukherjee (amukherj) 
------
commit 23440a73bc348bbc3bb43ec397f0639ee45865fc
Author: Kaushal M <kaushal>
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>
    Reviewed-on: http://review.gluster.org/12605
    Reviewed-by: Atin Mukherjee <amukherj>
    Reviewed-by: Anand Nekkunti <anekkunt>
    Tested-by: Gluster Build System <jenkins.com>
    Tested-by: NetBSD Build System <jenkins.org>

Comment 4 Niels de Vos 2016-06-16 13:44:42 UTC
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 15:31:30 UTC
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.