Bug 1160641

Summary: [USS]: After snapshot restore , if user is under snap directory which was restored, ls on the snap directory hangs
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: senaik
Component: snapshotAssignee: Sachin Pandit <spandit>
Status: CLOSED ERRATA QA Contact: senaik
Severity: medium Docs Contact:
Priority: unspecified    
Version: rhgs-3.0CC: nsathyan, rhinduja, rhs-bugs, rjoseph, spandit, storage-qa-internal, surs, vmallika
Target Milestone: ---Keywords: ZStream
Target Release: RHGS 3.0.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: USS
Fixed In Version: glusterfs-3.6.0.35 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-01-15 13:41:56 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: 1162694    

Description senaik 2014-11-05 10:03:35 UTC
Description of problem:
=========================
After restoring volume to a particular snapshot, if user is under .snaps/snap-directory(which was restored), ls under the snap directory hangs, instead it should give appropriate error message 

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


How reproducible:
=================
2/2

Steps to Reproduce:
===================
1.Create a 2x2 dist rep volume and start it
 
2.Fuse and NFS mount the volume, enable USS and create some IO 

3.Take a snapshot(snap1) 

4. Create some more IO and take few more snapshots(snap2, snap3)

5. cd to .snaps and cd to snap2 and list the files under them 

[root@dhcp-0-97 vol0_fuse]# cd dir2

[root@dhcp-0-97 dir2]# cd .snaps
[root@dhcp-0-97 .snaps]# ls
snap1  snap2  snap3

[root@dhcp-0-97 .snaps]# cd snap2
[root@dhcp-0-97 snap2]# ll
total 10240
-rw-r--r--. 1 root root 1048576 Nov  5 14:18 fuse11
-rw-r--r--. 1 root root 1048576 Nov  5 14:18 fuse12
-rw-r--r--. 1 root root 1048576 Nov  5 14:18 fuse13
-rw-r--r--. 1 root root 1048576 Nov  5 14:18 fuse14
-rw-r--r--. 1 root root 1048576 Nov  5 14:18 fuse15
-rw-r--r--. 1 root root 1048576 Nov  5 14:18 fuse16
-rw-r--r--. 1 root root 1048576 Nov  5 14:18 fuse17
-rw-r--r--. 1 root root 1048576 Nov  5 14:18 fuse18
-rw-r--r--. 1 root root 1048576 Nov  5 14:18 fuse19
-rw-r--r--. 1 root root 1048576 Nov  5 14:18 fuse20

[root@dhcp-0-97 snap2]# pwd
/mnt/vol0_fuse/dir2/.snaps/snap2

Remain in this path. 

6.Stop the volume and restore it to snap2 

7. Go back to the terminal in step5 and from the same path do a ls, it hangs . Instead it should give appropriate error message 

Actual results:
===============
After snapshot restore , if user is under snap directory which was restored, ls on the snap directory hangs

Expected results:
================
Appropriate error message should be displayed. 

Additional info:

Comment 3 senaik 2014-11-20 07:32:07 UTC
Version :glusterfs 3.6.0.33
=======

Another scenario where accessing .snaps hangs :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Create a 2x2 dist-rep volume 
-Fuse and NFS mount the volume, create some dir and files,
-Create few snapshots.
-Restore a volume to a deactivated snapshot- Successful.
-From fuse and nfs mount, cd to .snaps from the dirs created- it hangs 

[root@dhcp-0-97 d2_n]# cd .snaps

Comment 4 senaik 2014-11-20 12:47:51 UTC
Version :glusterfs 3.6.0.33
=======

Another scenario where accessing .snaps hangs :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Restore volume to a activated snapshot while glusterd is down on one node - 
  it is  Successful
- Start the volume
- Start glusterd on the node which was down
- cd to .snaps from fuse and nfs mount- it hangs

Comment 5 Sachin Pandit 2014-12-02 09:15:04 UTC
I tried reproducing the issue mentioned in description of the bug and also comment-3. But I did not hit the hang issue mentioned. I'll try reproducing
using steps mentioned in comment-4.

Comment 6 Sachin Pandit 2014-12-02 13:00:59 UTC
I tried to reproduce this issue as mentioned in the comments, but I could
not hit the issue. Can you please have a look into this.

Comment 7 Vijaikumar Mallikarjuna 2014-12-03 09:30:03 UTC
Patch https://code.engineering.redhat.com/gerrit/#/c/37398/ has fixed this issue

Comment 8 senaik 2014-12-16 04:59:03 UTC
Version : glusterfs 3.6.0.38 
========
Retried the steps as mentioned in Description and Comment 3 , works fine. No hang issue seen 

Scenario in Comment 4 is tracked by bz 1163209 

Marking this bug as 'Verified'

Comment 10 errata-xmlrpc 2015-01-15 13:41:56 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.

https://rhn.redhat.com/errata/RHBA-2015-0038.html