Bug 1159283

Summary: [USS]: if .snaps pre-exist and it contains files, than on enabling uss from nfs should show snaps under .snaps not files
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Rahul Hinduja <rhinduja>
Component: snapshotAssignee: Vijaikumar Mallikarjuna <vmallika>
Status: CLOSED NEXTRELEASE QA Contact: Rahul Hinduja <rhinduja>
Severity: high Docs Contact:
Priority: unspecified    
Version: rhgs-3.0CC: asengupt, rabhat, rhs-bugs, rjoseph, smohan, storage-qa-internal, surs, vmallika
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: USS
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1163898 1303595 (view as bug list) Environment:
Last Closed: 2016-02-01 12:00:38 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: 1159302, 1160678, 1163898, 1170502, 1303593, 1303595, 1303828, 1306163    

Description Rahul Hinduja 2014-10-31 11:38:45 UTC
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)

Comment 2 Raghavendra Bhat 2014-11-03 06:15:17 UTC
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 3 Vijaikumar 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.