Description of problem: When a file is renamed, say from 'a' to 'anew', and 'glusterfind pre' is run, the output file should have a mention a old file as well as new file, with the TYPE as 'rename'. It is getting recorded presently as: MODIFY anew Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Have a 2*2 distribute replicate volume 'ozone' 2. Create a glusterfind session 'sess1' for 'ozone' 3. Mount the volume using fuse, and create a file 'a' 4. Run 'glusterfind pre' and verify that an entry gets recorded in output file like: NEW a 5. Run 'glusterfind post' 6. Rename the file 'a' to 'anew', at the mountpoint 7. Run glusterfind pre again and verify the output file Actual results: Output file has an entry: MODIFY anew Expected results: RENAME a anew Additional info: ********************** CLIENT *************************** [root@dhcp43-71 ozone]# df -k . Filesystem 1K-blocks Used Available Use% Mounted on 10.70.43.48:/ozone 16756736 2072064 14684672 13% /mnt/ozone [root@dhcp43-71 ozone]# [root@dhcp43-71 ozone]# [root@dhcp43-71 ozone]# [root@dhcp43-71 ozone]# ls -l total 2 -rw-r--r--. 1 root root 0 Jun 3 21:07 b drwxr-xr-x. 3 root root 40 Jun 3 21:12 dir1 -rw-r--r--. 1 root root 51 Jun 3 21:10 newa2 [root@dhcp43-71 ozone]# mv b bnew [root@dhcp43-71 ozone]# ********************** SERVER ***************************** [root@dhcp43-48 ~]# gluster v info Volume Name: ozone Type: Distributed-Replicate Volume ID: aac2c2d4-ee24-499c-b264-4590006c576f Status: Started Number of Bricks: 2 x 2 = 4 Transport-type: tcp Bricks: Brick1: 10.70.43.48:/rhs/brick1/ozone Brick2: 10.70.42.147:/rhs/brick1/ozone Brick3: 10.70.43.48:/rhs/brick2/ozone Brick4: 10.70.42.147:/rhs/brick2/ozone Options Reconfigured: changelog.changelog: on storage.build-pgfid: on performance.readdir-ahead: on [root@dhcp43-48 ~]# [root@dhcp43-48 ~]# gluster peer status Number of Peers: 1 Hostname: 10.70.42.147 Uuid: 4ed533ad-4377-4af8-b13f-7ef3c67af600 State: Peer in Cluster (Connected) [root@dhcp43-48 ~]# [root@dhcp43-48 ~]# glusterfind list SESSION VOLUME SESSION TIME --------------------------------------------------------------------------- sess1 ozone 2015-06-03 21:08:16 [root@dhcp43-48 ~]# [root@dhcp43-48 ~]# [root@dhcp43-48 ~]# cat /tmp/out.txt MODIFY bnew [root@dhcp43-48 ~]#
pre command was run immediately after Rename. Changelog may not have rolled over and you will not get all the changes in output file. If you run pre command again then you will get Both Rename as well as Modify in output file. We will work on avoiding displaying MODIFY entry. This bug is similar to BZ 1226889
I verified the same steps again. Running the pre command the second time after 10 minutes, does not display any entry for RENAME. Only MODIFY gets recorded in the output file. [root@dhcp43-140 ~]# glusterfind pre testvol_sess testvol /tmp/outtest.txt Generated output file /tmp/outtest.txt [root@dhcp43-140 ~]# ls -l /tmp/outtest.txt -rw-r--r--. 1 root root 11 Jun 4 23:37 /tmp/outtest.txt [root@dhcp43-140 ~]# cat /tmp/outtest.txt NEW test1 [root@dhcp43-140 ~]# # after creating one more file and 2 directories [root@dhcp43-140 ~]# glusterfind post testvol_sess testvol [root@dhcp43-140 ~]# glusterfind pre testvol_sess testvol /tmp/outtest.txt Generated output file /tmp/outtest.txt [root@dhcp43-140 ~]# cat /tmp/outtest.txt NEW test2 NEW dir1 NEW dir2 [root@dhcp43-140 ~]# glusterfind post testvol_sess testvol [root@dhcp43-140 ~]# # after moving a file test1 to another directory , with a new name [root@dhcp43-140 ~]# glusterfind pre testvol_sess testvol /tmp/outtest.txt Generated output file /tmp/outtest.txt [root@dhcp43-140 ~]# cat /tmp/outtest.txt MODIFY dir1%2Fnewtest1 [root@dhcp43-140 ~]# # after moving another file to a different directory, retaining the name [root@dhcp43-140 ~]# glusterfind pre testvol_sess testvol /tmp/outtest.txt --regenerate-outfile Generated output file /tmp/outtest.txt [root@dhcp43-140 ~]# cat /tmp/outtest.txt MODIFY dir1%2Fnewtest1 MODIFY dir2%2Ftest2 [root@dhcp43-140 ~]# [root@dhcp43-140 ~]## after moving back test2 to its original location [root@dhcp43-140 ~]# [root@dhcp43-140 ~]# glusterfind pre testvol_sess testvol /tmp/outtest.txt --regenerate-outfile Generated output file /tmp/outtest.txt [root@dhcp43-140 ~]# cat /tmp/outtest.txt MODIFY dir1%2Fnewtest1 [root@dhcp43-140 ~]# glusterfind pre testvol_sess testvol /tmp/outtest.txt --regenerate-outfile Generated output file /tmp/outtest.txt [root@dhcp43-140 ~]# cat /tmp/outtest.txt MODIFY dir1%2Fnewtest1 [root@dhcp43-140 ~]#
I have posted a patch for Bug#1226889, http://review.gluster.org/c/11137/. and it resolves this issue. Please find the logs below. Let me know if any issues. [root@gfvm1 master]# touch newfile [root@gfvm1 master]# [root@gfvm1 master]# [root@gfvm1 master]# echo "b1";ls /opt/volume_test/tv_1/b1/ -la; echo "b2";ls /opt/volume_test/tv_1/b2/ -la b1 total 20 drwxr-xr-x 4 root root 4096 Jun 6 05:38 . drwxr-xr-x. 4 root root 4096 Jun 5 20:41 .. drw------- 53 root root 4096 Jun 6 04:57 .glusterfs drwxr-xr-x 3 root root 4096 Jun 5 20:41 .trashcan b2 total 28 drwxr-xr-x 4 root root 4096 Jun 6 07:37 . drwxr-xr-x. 4 root root 4096 Jun 5 20:41 .. drw------- 66 root root 4096 Jun 6 04:57 .glusterfs -rw-r--r-- 2 root root 0 Jun 6 07:37 newfile drwxr-xr-x 3 root root 4096 Jun 5 20:41 .trashcan [root@gfvm1 master]# [root@gfvm1 master]# [root@gfvm1 master]# glusterfind pre sess1 tv1 /tmp/out.txt Generated output file /tmp/out.txt [root@gfvm1 master]# cat /tmp/out.txt NEW newfile [root@gfvm1 master]# [root@gfvm1 master]# [root@gfvm1 master]# [root@gfvm1 master]# glusterfind post sess1 tv1 [root@gfvm1 master]# [root@gfvm1 master]# [root@gfvm1 master]# mv newfile newfile777 [root@gfvm1 master]# [root@gfvm1 master]# [root@gfvm1 master]# echo "b1";ls /opt/volume_test/tv_1/b1/ -la; echo "b2";ls /opt/volume_test/tv_1/b2/ -la b1 total 24 drwxr-xr-x 4 root root 4096 Jun 6 07:38 . drwxr-xr-x. 4 root root 4096 Jun 5 20:41 .. drw------- 54 root root 4096 Jun 6 07:38 .glusterfs ---------T 2 root root 0 Jun 6 07:38 newfile777 drwxr-xr-x 3 root root 4096 Jun 5 20:41 .trashcan b2 total 28 drwxr-xr-x 4 root root 4096 Jun 6 07:38 . drwxr-xr-x. 4 root root 4096 Jun 5 20:41 .. -rw-r--r-- 2 root root 0 Jun 6 04:57 222_1 drw------- 66 root root 4096 Jun 6 04:57 .glusterfs -rw-r--r-- 2 root root 0 Jun 6 07:37 newfile777 drwxr-xr-x 3 root root 4096 Jun 5 20:41 .trashcan [root@gfvm1 master]# glusterfind pre sess1 tv1 /tmp/out.txt Generated output file /tmp/out.txt [root@gfvm1 master]# [root@gfvm1 master]# cat /tmp/out.txt RENAME newfile newfile777 [root@gfvm1 master]#
Tested this on the build 3.7.1.3 and 3.7.1-4 build. Rename of a file does get recorded as RENAME and not a MODIFY. Functionality testing in and around this fix has been done, and logs of the same have been uploaded here: https://polarion.engineering.redhat.com/polarion/testrun-attachment/RHG3/glusterfs-3_7_1_3_RHEL6_7_FUSE/RHG3-5400_Logs_6.7_3.7.1-3_output_file_validation.odt Moving this to verified in 3.1 everglades.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2015-1495.html