Description of problem:
=======================
As per the current design if .snaps directory pre-exists and if it contains files. Than on enabling USS the .snaps directory from both fuse and nfs should show snaps created not the files. But with NFS protocol it still shows files and not snaps whereas it is working as expected from fuse and it shows snaps.
USS is enabled and there exist one snapshot named n1:
=====================================================
[root@wingo ~]# cd /mnt/vol2/
[root@wingo vol2]# ls
[root@wingo vol2]# cd .snaps/
[root@wingo .snaps]# ls
n1
[root@wingo .snaps]# cd
[root@wingo ~]# cd /mnt/nvol2
[root@wingo nvol2]# ls
[root@wingo nvol2]# cd .snaps/
[root@wingo .snaps]# ls
f1 f10 f2 f3 f4 f5 f6 f7 f8 f9 n1 n10 n2 n3 n4 n5 n6 n7 n8 n9
[root@wingo .snaps]# mount | grep vol2
inception.lab.eng.blr.redhat.com:/vol2 on /mnt/vol2 type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072)
inception.lab.eng.blr.redhat.com:/vol2 on /mnt/nvol2 type nfs (rw,vers=3,addr=10.70.34.50)
[root@wingo .snaps]#
Note above: /mnt/vol2 is fuse client and /mnt/nvol2 is nfs client
Version-Release number of selected component (if applicable):
=============================================================
glusterfs-3.6.0.30-1.el6rhs.x86_64
How reproducible:
=================
always
Steps to Reproduce:
===================
1. Create a volume vol2
2. Mount on fuse and nfs (/mnt/vol2 and /mnt/nvol2)
3. create a directory .snaps from /mnt/vol2
4. create files f{1..10} from /mnt/vol2 and n{1..10} from /mnt/nvol2
5. create a snapshot n1 of vol2
6. Enable USS
7. From fuse client cd /mnt/vol2/.snaps and ls
8. From nfs client cd /mnt/vol2/.snaps and ls
Actual results:
===============
From fuse:
----------
[root@wingo .snaps]# ls
n1
[root@wingo .snaps]#
From NFS:
---------
[root@wingo .snaps]# ls
f1 f10 f2 f3 f4 f5 f6 f7 f8 f9 n1 n10 n2 n3 n4 n5 n6 n7 n8 n9
[root@wingo .snaps]#
Expected results:
==================
From nfs too it should show the snaps created (n1)
The reason for nfs still showing old files is because, NFS client does heavy caching and it serves the request from the cache itself. This is equivalent to having 2 nfs clients, first accessing a directory from both the clients (so that both of the client cache the info), modify the directory from one of the clients. In this case the other client still shows old information itself (from its cache). For new changes to be visible, the caches have to be dropped.
Comment 3Vijaikumar Mallikarjuna
2016-02-01 12:00:38 UTC
This will be fixed in 3.1.z. Bug# 1303595 filed to track this issue for 3.1.z.