Bug 1160621 - [USS]: From NFS mount, unable to access the first snapshot under .snaps directory
Summary: [USS]: From NFS mount, unable to access the first snapshot under .snaps direc...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: snapshot
Version: rhgs-3.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Vijaikumar Mallikarjuna
QA Contact: Anoop
URL:
Whiteboard: USS
: 1159302 (view as bug list)
Depends On:
Blocks: 1153907 1160678 1163416 1303865 1316096
TreeView+ depends on / blocked
 
Reported: 2014-11-05 09:27 UTC by senaik
Modified: 2016-09-17 13:01 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
If the current directory is not a part of the snapshot say 'snap1', then the user cannot enter the '.snaps/snap1' directory.
Clone Of:
Environment:
Last Closed: 2016-02-02 09:23:43 UTC
Embargoed:


Attachments (Terms of Use)

Description senaik 2014-11-05 09:27:04 UTC
Description of problem:
=======================
After enabling USS on the volume where few snapshots were taken, from NFS mount, unable to access the first snapshot under .snaps directory

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

How reproducible:
================
3/3

Steps to Reproduce:
=================
1.Create a 2x2 dist rep volume(vol0)and start it 

2.Fuse and NFS mount the volume, enable USS on the volume and create some IO -created dir1 and few files under them
created nfs_dir1 and few files under them 

3.Take snapshot of the volume (snap1)

4.Create some more IO and take few more snapshots  

5.From fuse mount cd  to .snaps and list the snaps
[root@dhcp-0-97 dir2]# cd .snaps

[root@dhcp-0-97 .snaps]# ll
total 0
d---------. 0 root root 0 Jan  1  1970 snap1
d---------. 0 root root 0 Jan  1  1970 snap2
d---------. 0 root root 0 Jan  1  1970 snap3
[root@dhcp-0-97 .snaps]# cd snap2
[root@dhcp-0-97 snap2]# pwd
/mnt/vol0_fuse/dir2/.snaps/snap2


From NFS mount cd to .snaps and list the snaps

[root@dhcp-0-97 vol0_nfs]# ll
total 0
drwxr-xr-x. 2 root root 102 Nov  5 14:17 dir1
drwxr-xr-x. 2 root root  45 Nov  5 14:18 dir2
drwxr-xr-x. 2 root root 142 Nov  5 14:19 dir3
drwxr-xr-x. 2 root root  62 Nov  5 14:18 nfs_dir1
drwxr-xr-x. 2 root root 132 Nov  5 14:19 nfs_dir2
drwxr-xr-x. 2 root root 132 Nov  5 14:20 nfs_dir3

[root@dhcp-0-97 vol0_nfs]# cd nfs_dir2

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

[root@dhcp-0-97 .snaps]# ll
ls: cannot access snap1: No such file or directory 
total 0
??????????? ? ?    ?      ?            ? snap1
drwxr-xr-x. 2 root root 132 Nov  5 14:19 snap2
drwxr-xr-x. 2 root root 132 Nov  5 14:19 snap3

[root@dhcp-0-97 .snaps]# cd snap1
bash: cd: snap1: No such file or directory

[root@dhcp-0-97 .snaps]# cd snap2/
[root@dhcp-0-97 snap2]# ls
nfs11  nfs12  nfs13  nfs14  nfs15  nfs16  nfs17  nfs18  nfs19  nfs20


Actual results:
===============
From NFS mount unable to access the first snapshot under .snaps 


Expected results:
================
All the snaps should be listed and accessible under .snaps 


Additional info:

Comment 3 Vijaikumar Mallikarjuna 2014-11-11 08:37:04 UTC
the testcase mentioned in the description, dir 'nfs_dir2' is not part of snap1, so lookup will fails with ESTALE. 
NFS does getattr (stat) on all the files retrieved from readdir for caching. As snap1 doesn't contain dir 'nfs_dir2' it gets ESTALE and marks snap1 negative.

Even in FUSE mount, snap1 will be listed. but cd to snap1 will not work.

This is explained in 'https://bugzilla.redhat.com/show_bug.cgi?id=1159302#c4'.

Comment 4 Raghavendra Bhat 2014-11-25 12:15:08 UTC
As vijaykumar explained in the 3rd comment, this happens because, nfs client upon getting readdir responses, sends getattr on each of the entries it received. Now, since the directory nfs_dir2 (or to be more specific the gfid of nfs_dir2) is not present in snap1, getattr operation on that gfid in snap1 will fail and nfs client will send the o/p in the way mentioned in the bug description.

Comment 8 Pavithra 2014-12-24 03:39:37 UTC
Hi Vijai,

Can you review the edited doc text for technical accuracy and sign off?

Comment 9 Vijaikumar Mallikarjuna 2014-12-24 05:36:16 UTC
Hi Pavithra,

I have edited the doc-text. We can enter into '.snaps' directory but not into '.snaps/snapname/'

Comment 10 Avra Sengupta 2015-03-31 11:04:23 UTC
*** Bug 1159302 has been marked as a duplicate of this bug. ***

Comment 14 Vijaikumar Mallikarjuna 2016-02-02 09:23:43 UTC
This is an expected behavior and not a bug, so closing the bug


If the current directory '/dir' is not a part of the snapshot say 'snap1', then the user cannot enter the '/dir/.snaps/snap1' directory.


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