Bug 1218575

Summary: Snapshot-scheduling helper script errors out while running "snap_scheduler.py init"
Product: [Community] GlusterFS Reporter: rjoseph
Component: snapshotAssignee: Avra Sengupta <asengupt>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.7.0CC: amukherj, asengupt, bugs, gluster-bugs, skoduri
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.7.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1214574 Environment:
Last Closed: 2015-05-15 17:09:51 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: 1214574    
Bug Blocks:    

Description rjoseph 2015-05-05 09:44:06 UTC
+++ This bug was initially created as a clone of Bug #1214574 +++

Description of problem:
"snap_scheduler.py init" fails with following traceback:

Traceback (most recent call last):
  File "/usr/sbin/snap_scheduler.py", line 574, in <module>
    sys.exit(main())
  File "/usr/sbin/snap_scheduler.py", line 555, in main
    ret = perform_operation(args)
  File "/usr/sbin/snap_scheduler.py", line 408, in perform_operation
    ret = initialise_scheduler()
  File "/usr/sbin/snap_scheduler.py", line 349, in initialise_scheduler
    os.rename("/tmp/crontab", GCRON_UPDATE_TASK)
OSError: [Errno 18] Invalid cross-device link


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


How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:
snap_scheduler.py init fails with traceback.

Expected results:
snapshot scheduler has to be initialized properly by running the script.

Additional info:

--- Additional comment from Anand Avati on 2015-04-23 03:20:37 EDT ---

REVIEW: http://review.gluster.org/10347 (snapshot/scheduler: Use a .tmp file in /etc/cron.d instead of /tmp) posted (#1) for review on master by Avra Sengupta (asengupt)

--- Additional comment from Anand Avati on 2015-04-23 04:28:47 EDT ---

REVIEW: http://review.gluster.org/10347 (snapshot/scheduler: Use a .tmp file in /etc/cron.d instead of /tmp) posted (#2) for review on master by Avra Sengupta (asengupt)

--- Additional comment from Anand Avati on 2015-04-29 02:39:15 EDT ---

REVIEW: http://review.gluster.org/10347 (snapshot/scheduler: Use shutil.move instead of os.rename()) posted (#3) for review on master by Avra Sengupta (asengupt)

--- Additional comment from Anand Avati on 2015-04-29 03:57:48 EDT ---

REVIEW: http://review.gluster.org/10347 (snapshot/scheduler: Use shutil.move instead of os.rename()) posted (#4) for review on master by Avra Sengupta (asengupt)

--- Additional comment from Anand Avati on 2015-04-30 04:28:18 EDT ---

COMMIT: http://review.gluster.org/10347 committed in master by Krishnan Parthasarathi (kparthas) 
------
commit 0be5e3d7c580f77f3db0d4282d2ac81071ccd3f5
Author: Avra Sengupta <asengupt>
Date:   Wed Apr 29 12:02:05 2015 +0530

    snapshot/scheduler: Use shutil.move instead of os.rename()
    
    os.rename is a wrapper on top of the rename function,
    which fails with invalid cross-device link if /tmp
    is a tmpfs. Hence using shutil.move
    
    Change-Id: Ia026d2a810b725ccd398db895e612c53bc6a2f95
    BUG: 1214574
    Signed-off-by: Avra Sengupta <asengupt>
    Reviewed-on: http://review.gluster.org/10347
    Reviewed-by: Rajesh Joseph <rjoseph>
    Reviewed-by: Aravinda VK <avishwan>
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Krishnan Parthasarathi <kparthas>

Comment 1 Anand Avati 2015-05-06 11:17:36 UTC
COMMIT: http://review.gluster.org/10560 committed in release-3.7 by Vijay Bellur (vbellur) 
------
commit eeb41c11aeba4de93e979dfefc4d4c60b26d9447
Author: Avra Sengupta <asengupt>
Date:   Wed Apr 29 12:02:05 2015 +0530

    snapshot/scheduler: Use shutil.move instead of os.rename()
    
    os.rename is a wrapper on top of the rename function,
    which fails with invalid cross-device link if /tmp
    is a tmpfs. Hence using shutil.move
    
    Change-Id: Ia026d2a810b725ccd398db895e612c53bc6a2f95
    BUG: 1218575
    Signed-off-by: Avra Sengupta <asengupt>
    Reviewed-on: http://review.gluster.org/10347
    Reviewed-by: Rajesh Joseph <rjoseph>
    Reviewed-by: Aravinda VK <avishwan>
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Krishnan Parthasarathi <kparthas>
    Reviewed-on: http://review.gluster.org/10560

Comment 2 Niels de Vos 2015-05-15 17:09:51 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.7.0, please open a new bug report.

glusterfs-3.7.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://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user