Bug 1045305

Summary: [SNAPSHOT] : snap create command returned failure for snap names starts with -, but snap is listed on local host
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Rahul Hinduja <rhinduja>
Component: snapshotAssignee: Avra Sengupta <asengupt>
Status: CLOSED ERRATA QA Contact: Rahul Hinduja <rhinduja>
Severity: medium Docs Contact:
Priority: medium    
Version: rhgs-3.0CC: asengupt, nsathyan, rhs-bugs, sdharane, senaik, ssamanta, storage-qa-internal
Target Milestone: ---   
Target Release: RHGS 3.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: SNAPSHOT
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-22 19:30:52 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:

Description Rahul Hinduja 2013-12-20 06:16:17 UTC
Description of problem:
=======================

When snapshot is created with snap name starts with "-" (other than -n/-d), command fails but snapshot is listed on the local host.

Created a snapshot using:
=========================

[root@snapshot-09 ~]# gluster snapshot create vol-snap0 -n "-r"
snapshot create: failed: Commit failed on localhost. Please check log file for details.
Snapshot command failed
[root@snapshot-09 ~]#

snapshot create failed

But snapshot is listed on the localhost:
=========================================

[root@snapshot-09 ~]# gluster snapshot list vol-snap0

Volume Name : vol-snap0
Number of snaps taken : 1
Number of snaps available : 255

	Snap Name : -r
	Snap Time : 2013-12-20 04:40:06
	Snap ID : 5dbfb847-e4cc-4f70-88e4-3a8e5242df56
[root@snapshot-09 ~]# 

But on the other nodes in cluster snapshot is not listed:
=========================================================

[root@snapshot-10 ~]# gluster snapshot list vol-snap0

Volume Name : vol-snap0
Number of snaps taken : 0
Number of snaps available : 256
[root@snapshot-10 ~]# 

[root@snapshot-11 ~]# gluster snapshot list vol-snap0

Volume Name : vol-snap0
Number of snaps taken : 0
Number of snaps available : 256
[root@snapshot-11 ~]# 


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

glusterfs-3.4.0.snap.dec03.2013git-1.el6.x86_64


How reproducible:
=================
1/1


Steps to Reproduce:
1. Create a snapshot with snap name as (-<name>)
2. list the snapshot on local host
3. list the snapshot on other nodes in cluster

Actual results:
===============
create failed, but snapshot is listed on local host not on others


Expected results:
=================
When a create fails it should not list on any node. Also -r is considered a valid snap name, it should not fail.

Comment 2 Avra Sengupta 2014-01-13 11:26:10 UTC
Fixed with http://review.gluster.org/#/c/6453/

Comment 3 Rahul Hinduja 2014-01-16 11:44:11 UTC
Verified with the build: glusterfs-3.4.1.snap.jan15.2014git-1.el6.x86_64

Snap create command fails when snap name starts with "-". Also none of the node in cluster displays that. 

[root@snapshot-09 ~]# gluster snapshot create vol0 -n -r
snapshot create: failed: Commit failed on localhost. Please check log file for details.
Snapshot command failed
[root@snapshot-09 ~]#
[root@snapshot-09 ~]# gluster snap list vol0

Volume Name                  : vol0
Number of snaps taken        : 0
Number of snaps available    : 256
[root@snapshot-09 ~]# 


[root@snapshot-10 ~]# gluster snap list vol0

Volume Name                  : vol0
Number of snaps taken        : 0
Number of snaps available    : 256
[root@snapshot-10 ~]# 


[root@snapshot-11 ~]# gluster snap list vol0

Volume Name                  : vol0
Number of snaps taken        : 0
Number of snaps available    : 256
[root@snapshot-11 ~]# 

[root@snapshot-12 ~]# gluster snap list vol0

Volume Name                  : vol0
Number of snaps taken        : 0
Number of snaps available    : 256
[root@snapshot-12 ~]# 


Moving the bug to verified

Comment 5 Nagaprasad Sathyanarayana 2014-04-21 06:18:18 UTC
Marking snapshot BZs to RHS 3.0.

Comment 6 Nagaprasad Sathyanarayana 2014-05-19 10:56:42 UTC
Setting flags required to add BZs to RHS 3.0 Errata

Comment 9 errata-xmlrpc 2014-09-22 19:30:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2014-1278.html