Bug 1282318 - DHT : file rename operation is successful but log has error 'key:trusted.glusterfs.dht.linkto error:File exists' , 'setting xattrs on <old_filename> failed (File exists)'
DHT : file rename operation is successful but log has error 'key:trusted.glus...
Status: VERIFIED
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: distribute (Show other bugs)
3.1
x86_64 Linux
unspecified Severity medium
: ---
: RHGS 3.4.0
Assigned To: Mohit Agrawal
Prasad Desala
dht-rca-unknown, dht-log, rebase
: Triaged, ZStream
: 1328000 (view as bug list)
Depends On: 1030200
Blocks: 1503134 1404905
  Show dependency treegraph
 
Reported: 2015-11-16 00:32 EST by Sakshi
Modified: 2018-05-24 17:32 EDT (History)
15 users (show)

See Also:
Fixed In Version: glusterfs-3.12.2-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1030200
: 1404905 (view as bug list)
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Comment 2 Nithya Balachandran 2016-05-03 05:05:24 EDT
*** Bug 1328000 has been marked as a duplicate of this bug. ***
Comment 4 Raghavendra G 2016-07-05 02:13:38 EDT
The fix we thought is to move the log in posix_mknod to DEBUG level
Comment 6 surabhi 2016-09-19 05:35:36 EDT
A 2x2 dis-rep volume , mounted on cifs client and running different fops on client using crefi, following error messages are seen in brick logs:
[2016-09-19 07:06:54.089211] E [MSGID: 113001] [posix-helpers.c:1175:posix_handle_pair] 0-testvol-posix: /mnt/brick/testvol/b2/thread0/level00/hardlink_to_files/57df8e7
3%%YLW8207V72: key:trusted.glusterfs.dht.linktoflags: 1 length:20 [File exists]
[2016-09-19 07:06:54.089256] E [MSGID: 113001] [posix.c:1353:posix_mknod] 0-testvol-posix: setting xattrs on /mnt/brick/testvol/b2/thread0/level00/hardlink_to_files/57d
f8e73%%YLW8207V72 failed
[2016-09-19 07:06:54.145984] E [MSGID: 113001] [posix-helpers.c:1175:posix_handle_pair] 0-testvol-posix: /mnt/brick/testvol/b2/thread0/level00/hardlink_to_files/57df8e7
4%%2BTFGH1HJS: key:trusted.glusterfs.dht.linktoflags: 1 length:20 [File exists]
[2016-09-19 07:06:54.146008] E [MSGID: 113001] [posix.c:1353:posix_mknod] 0-testvol-posix: setting xattrs on /mnt/brick/testvol/b2/thread0/level00/hardlink_to_files/57d
f8e74%%2BTFGH1HJS failed
Comment 7 Mohit Agrawal 2016-12-14 23:27:22 EST
Below are the steps to reproduce the issue on plain distributed environment

touch file{1..20}
for i in `seq 1 20`; do ln file$i filehl$i; done
for i in `seq 1 20`; do mv file$i new_file$i; done

RCA: file rename operation is successful but message is coming in brick logs 
     "key:trusted.glusterfs.dht.linkto error:File exists".
     The messages are coming in logs because call (sys_lsetxattr) is returning
     error code(EEXIST) and it is returning error because key xattr is already 
     exists on the file before run rename operation.To avoid the message need to
     put a check(EEXIST) before print the message.
Comment 8 Nithya Balachandran 2016-12-15 00:47:42 EST
(In reply to Mohit Agrawal from comment #7)
> Below are the steps to reproduce the issue on plain distributed environment
> 
> touch file{1..20}
> for i in `seq 1 20`; do ln file$i filehl$i; done
> for i in `seq 1 20`; do mv file$i new_file$i; done
> 
> RCA: file rename operation is successful but message is coming in brick logs 
>      "key:trusted.glusterfs.dht.linkto error:File exists".
>      The messages are coming in logs because call (sys_lsetxattr) is
> returning
>      error code(EEXIST) and it is returning error because key xattr is
> already 
>      exists on the file before run rename operation.To avoid the message
> need to
>      put a check(EEXIST) before print the message.

Can we be sure that the value of the xattr is the same?
Comment 9 Mohit Agrawal 2016-12-15 00:57:49 EST
lsetxattr returns EEXIST only when same attribute already exists on the file so i believe 
the value is same.

Regards
Mohit Agrawal
Comment 10 Mohit Agrawal 2016-12-15 01:04:02 EST
Please ignore my last comment not sure about the value,value could be different only attribute name is same but in both cases (value is same or different) it will update new value to the xattr.

Regards
Mohit Agrawal
Comment 14 Prasad Desala 2018-02-19 08:11:58 EST
Verified this BZ on glusterfs version: 3.12.2-4.el7rhgs.x86_64.
Followed the same steps as in the description and Comment 7. Rename is successful and logs didn't throw any errors mentioned in the BZ.

Hence, moving this BZ to Verified.

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