Bug 1117165

Summary: DHT :- rename of file failed with error ' <src> and <dest> are the same file' if <src> file has been alreay renamed to <dest> from another mount point
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Rachana Patel <racpatel>
Component: fuseAssignee: Csaba Henk <csaba>
Status: CLOSED WONTFIX QA Contact: Rahul Hinduja <rhinduja>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rhgs-3.0CC: mzywusko, nbalacha, rhs-bugs, smohan, storage-qa-internal, vbellur
Target Milestone: ---Keywords: ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: dht-rename-file
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-16 18:02:13 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:

Description Rachana Patel 2014-07-08 07:49:05 UTC
Description of problem:
=======================
On a distributed volume, If <source> file does not exist(<source> file has been renamed to <dest> from another mount point) then rename from <src> <dest> fails with 'are the same file' error. It should failed with 'No such file or Directory' error.


Version-Release number :
=========================
3.6.0.24-1.el6rhs.x86_64


How reproducible:
=================
Intermittent 


Steps to Reproduce:
====================
1. create and mount distributed volume. (mount on multiple client)
2. create few files from mount point.
[root@OVM1 ren]# touch a{1..10}

3. now from one mount point rename files and from another mount point rename same file .
[root@OVM3 ren]# for i in {1..10} ; do mv a$i b$i ; done

[root@OVM1 ren]# for i in {1..10} ; do mv a$i b$i ; done
mv: overwrite `b6'? n
mv: `a7' and `b7' are the same file
mv: `a8' and `b8' are the same file
mv: `a9' and `b9' are the same file
mv: `a10' and `b10' are the same file

[root@OVM1 ren]# ls
b1  b10  b2  b3  b4  b5  b6  b7  b8  b9

-->  for few files it's failing with error 'mv: `a7' and `b7' are the same file'



Actual results:
===============
Rename is failing with are the same file



Expected results:
===============
It should fail with 'No Such file or Directory' error

Additional Info:-
=================
log:-
[2014-07-07 16:40:26.109472] W [dht-linkfile.c:49:dht_linkfile_lookup_cbk] 0-ren-dht: got non-linkfile ren-client-2:/b5, gfid = 00000000-0000-0000-0000-000000000000
[2014-07-07 16:40:26.113137] D [fuse-resolve.c:83:fuse_resolve_entry_cbk] 0-fuse: 00000000-0000-0000-0000-000000000001/b6: failed to resolve (No such file or directory)
[2014-07-07 16:40:26.117122] D [fuse-resolve.c:83:fuse_resolve_entry_cbk] 0-fuse: 00000000-0000-0000-0000-000000000001/b6: failed to resolve (No such file or directory)
[2014-07-07 16:40:26.118762] D [MSGID: 0] [dht-common.c:1087:dht_lookup_everywhere_cbk] 0-ren-dht: found on ren-client-0 file /b6
[2014-07-07 16:40:26.118850] D [MSGID: 0] [dht-common.c:972:dht_lookup_everywhere_done] 0-ren-dht: Linking file /b6 on ren-client-0 to ren-client-2 (hash)(gfid = 00000000-0000-0000-0000-000000000000)
[2014-07-07 16:40:26.119481] W [client-rpc-fops.c:240:client3_3_mknod_cbk] 0-ren-client-2: remote operation failed: File exists. Path: /b6
[2014-07-07 16:40:37.540637] D [fuse-bridge.c:49:fuse_invalidate] 0-fuse: Invalidate inode id 140282468394284.
[2014-07-07 16:40:37.545079] D [fuse-bridge.c:49:fuse_invalidate] 0-fuse: Invalidate inode id 140282468393972.
[2014-07-07 16:40:37.549575] D [fuse-bridge.c:49:fuse_invalidate] 0-fuse: Invalidate inode id 140282468394440.
[2014-07-07 16:40:37.553626] D [fuse-bridge.c:49:fuse_invalidate] 0-fuse: Invalidate inode id 140282468394752.

Comment 8 Raghavendra G 2016-06-23 05:12:29 UTC
Karthick ran similar test cases as part of 3.1.3 testing and he didn't see the bug. However, leaving the bug open for further analysis from dev.