Bug 1231983 - Upstart job mounting-glusterfs.conf increases unnecessary 30 seconds in Ubuntu boot
Summary: Upstart job mounting-glusterfs.conf increases unnecessary 30 seconds in Ubunt...
Status: CLOSED WORKSFORME
Alias: None
Product: GlusterFS
Classification: Community
Component: packaging
Version: mainline
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Keywords: Patch, Triaged
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-15 18:26 UTC by Rarylson Freitas
Modified: 2018-10-12 06:58 UTC (History)
6 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2018-10-12 06:58:01 UTC


Attachments (Terms of Use)
Fixed version of mounting-glusterfs.conf (389 bytes, text/plain)
2015-06-15 18:26 UTC, Rarylson Freitas
no flags Details

Description Rarylson Freitas 2015-06-15 18:26:59 UTC
Created attachment 1039191 [details]
Fixed version of mounting-glusterfs.conf

Description of problem:

A bug in the mounting-glusterfs.conf file increases unnecessary 30 seconds in the boot in an Ubuntu Server.

The following error is logged in /var/log/upstart/mounting-gluster-*.log: "start: Job failed to start".

The following error is also logged in /var/log/upstart/wait-for-state-mounting-glusterfs-*.log:

"status: Unknown job: static-network-up
start: Unknown job: static-network-up".

For last, another error ("Mount failed") is logged in /var/log/boot.log too.

When not using the nobootwait/nofail flags in fstab, the bug can hang the mount process (and the boot process too). When using the nobootwait/nofail flags, the bug will increase the boot time in about 30 seconds.

Another report from another GlusterFS user can be found at [this link](http://serverfault.com/questions/611462/glusterfs-failing-to-mount-at-boot-with-ubuntu-14-04).

The bug is caused by the following errors:

- There is no need to wait for the network is up. The Ubuntu itself has the _netdev mount flag that will retry the mount for each time that an interface brings up;
- However, it's necessary to wait for the GlusterFS Server daemon (for mounts using localhost);
    - This was implemented in an old commit ([c3bbf6](https://github.com/gluster/glusterfs/commit/c3bbf6aa6c090fd066ab0079aa1c8ae332309d2a)), more precisely in [this link](https://github.com/gluster/glusterfs/blob/c3bbf6aa6c090fd066ab0079aa1c8ae332309d2a/extras/Ubuntu/mounting-glusterfs.conf). However, this commit was overwritten;
- It's wrong to use the wait-for-state upstart task to wait for a signal. It's used to wait for a job. static-network-up is an event signal, and not a job;
    - This is why the "Unknown job: static-network-up" is logged;
- It's wrong, when waiting for a job to be started, not passing the 'WAIT_STATE=running' env var because it's not the default in wait-for-state.

PS: This is not a real GlusterFS bug, but it's a bug in the specific files of the Ubuntu distribution. However, these files are versioned in the upstream.


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

Master branch (mainline, commit https://github.com/gluster/glusterfs/commit/5cdbbf34e31758071f597561aa8572cedd56aece) and the glusterfs-server and glusterfs-client packages in Ubuntu 14.04 (maybe the packages in other Ubuntu versions too).


How reproducible:

Every system boot.


Steps to Reproduce:

1. Create a valid volume in a Gluster Server
2. Create an entry in the /etc/fstab file in a Ubuntu 14.04 like:
   gluster1:/dir /var/dir glusterfs defaults,nobootwait,nofail,_netdev 0 0
3. Reboot the system
4. Run 'mount' and check that the volume was mounted 
5. Check the boot and upstart logs that shows the problem

To see more easily this problem, it's also possible:

1. Create a valid volume in a Gluster Server
2. Create an entry in the /etc/fstab file in a Ubuntu 14.04 like:
   gluster1:/dir /var/dir glusterfs defaults,nobootwait,nofail,_netdev 0 0
3. Run 'time start mountall'
4. Run 'mount' and check that the volume was mounted 
5. Check the upstart logs and the high value time output (about 30 seconds).

Actual results:

Errors logged and 30 seconds of unnecessary waiting.

Expected results:

The volume mounted as long as the desired interface is up (_netdev) and the gluster daemon (if it exists) is up, without errors being logged.

Additional info:

The files that need to be updated are [README.Ubuntu](https://github.com/gluster/glusterfs/commits/master/extras/Ubuntu/README.Ubuntu) and [mounting-glusterfs.conf](https://github.com/gluster/glusterfs/blob/master/extras/Ubuntu/mounting-glusterfs.conf).

A fixed version of 'mounting-glusterfs.conf' will be attached to this bug report.

Comment 1 chrone 2015-08-23 17:08:41 UTC
Thanks Rarylson,

The patch works on Ubuntu 12.04.5 with GlusterFS 3.6. :)

/chrone

Comment 2 Amar Tumballi 2018-10-12 06:58:01 UTC
I see the same file is not changed in 6 years! Closing as worksforme (as per comment #1)

Please re-open the bug if anything is required!


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