Bug 822361

Summary: Lookup of files with gfid's (created from backend) on nfs mount are not force merged
Product: [Community] GlusterFS Reporter: Shwetha Panduranga <shwetha.h.panduranga>
Component: nfsAssignee: GlusterFS Bugs list <gluster-bugs>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: mainlineCC: bugs, gluster-bugs, ndevos, pkarampu, vagarwal, vbellur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-25 13:40:34 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
Automation test run result
nfs server log none

Description Shwetha Panduranga 2012-05-17 03:19:58 EDT
Created attachment 585124 [details]
Automation test run result

Description of problem:
files are created and are assigned gfid's on the bricks from the backed.Create a volume with the same bricks where the files were created.Create a nfs mount to the volume and look up on mount point should force merge these files onto the bricks. But the lookup is returning "No such file or directory" Error. 

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

How reproducible:

Steps to Reproduce:
1. create a file 'f1' on brick1 and 'f2' on brick2 from the backend
2. assign gfid's to the files 'f1' and 'f2'
3. create a replicate volume (1x2) with brick1 and brick2
4. create a nfs mount. 
5. execute 'ls -l' from nfs mount
Actual results:
2012-05-17 11:16:18,216 DEBUG  : /home/tester/Testing/automation/libs/utils/hostutils.py execute_command 184 - ' Executing Command: cd /mnt/nfsc1 ; ls -l'
2012-05-17 11:16:18,343 DEBUG  : /home/tester/Testing/automation/libs/utils/atfutils.py print_stdout 154 - 'total 0
2012-05-17 11:16:18,343 DEBUG  : /home/tester/Testing/automation/libs/utils/atfutils.py print_stdout 154 - '-????????? ? ? ? ?            ? f1
2012-05-17 11:16:18,344 DEBUG  : /home/tester/Testing/automation/libs/utils/atfutils.py print_stderr 160 - 'ls: cannot access f1: No such file or directory

Expected results:
Should force merge of files f1 and f2. 

Additional Info:-
The same test works fine on fuse mount.
Comment 1 Shwetha Panduranga 2012-05-17 03:20:53 EDT
Created attachment 585126 [details]
nfs server log
Comment 2 Pranith Kumar K 2012-12-11 03:38:33 EST
happens on distribute as well. Assigning to Rajesh.
gluster --mode=script volume create d1
volume create: d1: success: please start the volume to access data
gluster --mode=script volume start d1
volume start: d1: success
gluster --mode=script volume set d1 client-log-level DEBUG
volume set: success
gluster --mode=script volume set d1 brick-log-level DEBUG
volume set: success
mkdir: cannot create directory `/mnt/d1': File exists

mount -t glusterfs /mnt/d1

root - ~ 
14:07:48 :) ⚡ 

root - ~ 
14:08:00 :) ⚡ mount -t nfs /mnt/client -o vers=3

root - ~ 
14:08:09 :) ⚡ touch /gfs/d1_0/a

root - ~ 
14:08:18 :) ⚡ ls -l /mnt/client
ls: /mnt/client/a: No such file or directory
total 0
-rw-r--r-- 0 root root 0 Dec 11 14:08 a

root - ~ 
14:08:22 :) ⚡ ls -l /mnt/client
ls: /mnt/client/a: No such file or directory
total 0
-rw-r--r-- 0 root root 0 Dec 11 14:08 a

root - ~ 
14:08:22 :) ⚡ ls -l /mnt/client
ls: /mnt/client/a: No such file or directory
total 0
-rw-r--r-- 0 root root 0 Dec 11 14:08 a
Comment 3 Rajesh 2013-07-01 06:22:23 EDT
To force merge a file created in the backend directly for use in NFS, we need to have the exact hard/soft link in the backend .glusterfs directory, since NFS uses anonymous fds to operate on files.
Comment 4 Niels de Vos 2014-10-25 13:40:34 EDT
I'll close this as NOTABUG because this is not a valid use-case in current versions. We expect that the .glusterfs directory on the bricks have hardlinks to the files. NFS uses these hardlinks to stat() a file, if these links are missing, things tend to got wrong.

Please re-open if this still is an issue and you have a real-world use-case.