Description of problem: The attribute '--output-prefix' is specified in 'glusterfind pre' command when we would like the list of files (recorded in the output file) to be prefix'ed with a specific path. In case of a scenario where we have multiple NEW, MODIFY, RENAME and DELETE entries, and when 'glusterfind pre <sessionName> <volName> <outfile> --output-prefix <prefix>' is executed, the outfile is correctly generated.. with the specified prefix for all the corresponding NEW/MODIFY/RENAME/DELETE entries. BUT, if we have only DELETE entries in the output file, then the prefix fails to get itself logged in the output file. Version-Release number of selected component (if applicable): glusterfs-3.7.1-7.el6rhs.x86_64 How reproducible: 3:3 Steps to Reproduce: 1. Have a >2 node cluster, with volume 'testvol' 2. Create 2 files 'test1' and 'test2' 3. Run glusterfind pre with '--output-prefix <prefix>' and glusterfind post and verify the output file 4. Create two directories 'dir1' and 'dir1/dir2' and touch 'test2' and rm 'test1' 5. Run glusterfind pre with '--output-prefix <prefix> ' and glusterfind post and verify the output file 6. Remove directory dir2 7. Run glusterfind pre with '--output-prefix <prefix>' and glusterfind post and verify the output file Actual results: Step7 displays the output as: DELETE dir1/dir2 Expected results: Step7 should display the output as: DELETE <prefix>/dir1/dir2 Additional info: SERVER ========== [root@dhcp43-93 ~]# gluster v list testvol [root@dhcp43-93 ~]# [root@dhcp43-93 ~]# [root@dhcp43-93 ~]# glusterfind list SESSION VOLUME SESSION TIME --------------------------------------------------------------------------- testvol_session_55 testvol 2015-07-09 16:48:00 testvol_session_76 testvol 2015-07-09 16:50:54 so1 ozone 2015-07-08 23:45:24 [root@dhcp43-93 ~]# [root@dhcp43-93 ~]# [root@dhcp43-93 ~]# # after creating two new files 'test1 and test2' [root@dhcp43-93 ~]# glusterfind pre testvol_session_55 testvol /tmp/out.txt --output-prefix '/mnt/glusterfs/' Generated output file /tmp/out.txt [root@dhcp43-93 ~]# cat /tmp/out.txt NEW %2Fmnt%2Fglusterfs%2Ftest1 NEW %2Fmnt%2Fglusterfs%2Ftest2 [root@dhcp43-93 ~]# [root@dhcp43-93 ~]# [root@dhcp43-93 ~]# # after creating dir1/, dir1/dir2, touching test2, and removing test1 [root@dhcp43-93 ~]# [root@dhcp43-93 ~]# glusterfin dpost testvol_session_55 testvol -bash: glusterfin: command not found [root@dhcp43-93 ~]# glusterfind post testvol_session_55 testvol Session testvol_session_55 with volume testvol updated [root@dhcp43-93 ~]# [root@dhcp43-93 ~]# [root@dhcp43-93 ~]# glusterfind pre testvol_session_55 testvol /tmp/out.txt --output-prefix '/mnt/glusterfs/' Generated output file /tmp/out.txt [root@dhcp43-93 ~]# cat /tmp/out.txt NEW %2Fmnt%2Fglusterfs%2Fdir1 NEW %2Fmnt%2Fglusterfs%2Fdir1%2Fdir2 MODIFY %2Fmnt%2Fglusterfs%2Ftest2 DELETE %2Fmnt%2Fglusterfs%2Ftest1 [root@dhcp43-93 ~]# glusterfind post testvol_session_55 testvol Session testvol_session_55 with volume testvol updated [root@dhcp43-93 ~]# # after just deleting dir1/dir2 [root@dhcp43-93 ~]# [root@dhcp43-93 ~]# glusterfind pre testvol_session_55 testvol /tmp/out.txt --output-prefix '/mnt/glusterfs/' Generated output file /tmp/out.txt [root@dhcp43-93 ~]# cat /tmp/out.txt DELETE dir1%2Fdir2 [root@dhcp43-93 ~]# [root@dhcp43-93 ~]# rpm -qa | grep gluster glusterfs-client-xlators-3.7.1-7.el6rhs.x86_64 glusterfs-server-3.7.1-7.el6rhs.x86_64 glusterfs-3.7.1-7.el6rhs.x86_64 glusterfs-api-3.7.1-7.el6rhs.x86_64 glusterfs-cli-3.7.1-7.el6rhs.x86_64 glusterfs-geo-replication-3.7.1-7.el6rhs.x86_64 glusterfs-libs-3.7.1-7.el6rhs.x86_64 glusterfs-fuse-3.7.1-7.el6rhs.x86_64 [root@dhcp43-93 ~]# CLIENT ========= [root@dhcp43-71 ~]# mount | grep 43.93 10.70.43.93:/vol1 on /mnt/vol1 type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072) 10.70.43.93:/ozone on /mnt/oz type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072) 10.70.43.93:testvol on /mnt/glusterfs type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072) [root@dhcp43-71 ~]# [root@dhcp43-71 ~]# [root@dhcp43-71 ~]# cd /mnt/glusterfs/ [root@dhcp43-71 glusterfs]# ls 559e58f0%%12GO6GX4YT.tar.gz 559e58ff%%W7KAPVCOQN.tar.gz 559e5904%%9NGQ7ENTWH glusterfs perl 559e58f6%%GFF7D0Y1CL.tar.gz 559e58ff%%W7KAPVCOQN.tar.gz_hdlink_78 559e5904%%FTMGFFDRE4 level00 perl_smlink_38 559e58fa%%5GM8S35YQG.tar.gz 559e5903%%HXVAP7630A 559e5905%%W8FFAKQWCX level01 [root@dhcp43-71 glusterfs]# rm -rf * [root@dhcp43-71 glusterfs]# [root@dhcp43-71 glusterfs]# [root@dhcp43-71 glusterfs]# [root@dhcp43-71 glusterfs]# [root@dhcp43-71 glusterfs]# echo "hello world" > test1 [root@dhcp43-71 glusterfs]# touch test2 [root@dhcp43-71 glusterfs]# [root@dhcp43-71 glusterfs]# mkdir -p dir1/dir2 [root@dhcp43-71 glusterfs]# [root@dhcp43-71 glusterfs]# touch test2 [root@dhcp43-71 glusterfs]# [root@dhcp43-71 glusterfs]# rm test1 rm: remove regular file `test1'? y [root@dhcp43-71 glusterfs]# ls -a . .. dir1 test2 .trashcan [root@dhcp43-71 glusterfs]# [root@dhcp43-71 glusterfs]# ls dir1 test2 [root@dhcp43-71 glusterfs]# [root@dhcp43-71 glusterfs]# [root@dhcp43-71 glusterfs]# rm dir1/dir2 rm: cannot remove `dir1/dir2': Is a directory [root@dhcp43-71 glusterfs]# rm -r dir1/dir2 rm: remove directory `dir1/dir2'? y [root@dhcp43-71 glusterfs]# ls -lrt total 2 -rw-r--r--. 1 root root 0 Jul 9 17:36 test2 drwxr-xr-x. 2 root root 24 Jul 9 17:39 dir1 [root@dhcp43-71 glusterfs]# ls -lrt dir1 total 0 [root@dhcp43-71 glusterfs]# [root@dhcp43-71 glusterfs]# rpm -qa | grep gluster glusterfs-fuse-3.7.1-3.el6.x86_64 glusterfs-libs-3.7.1-3.el6.x86_64 glusterfs-client-xlators-3.7.1-3.el6.x86_64 glusterfs-3.7.1-3.el6.x86_64 [root@dhcp43-71 glusterfs]#
Doc text is edited. Please sign off to be included in Known Issues.
The doc text here does not have a mention of glusterfind at all. With just what is written - and which is now included in the 3.1 release notes, it does not give the correct picture. What do you think? Presently, it is this: Due to a code bug, the output prefix was not considered when updating the path of deleted entries. The output file/dir name will not have an output prefix. Expected, could look like this: Due to a code bug, the output prefix was not considered when updating the path of deleted entries. The output file/dir name will not have an output prefix in case of deleted entry present in the outfile of glusterfind.
Have edited the doc text.
I am affirmative!
Patch posted upstream http://review.gluster.org/#/c/11712/
Downstream patch https://code.engineering.redhat.com/gerrit/#/c/56398/
Verified with build: glusterfs-3.7.1-14.el7rhgs.x86_64 Creation: ========= [root@georep1 ~]# cat /root/log NEW root%2Ftest1 NEW root%2Ftest2 [root@georep1 ~]# Modify/Delete: ============= [root@georep1 ~]# cat /root/log NEW root%2Fdir1 NEW root%2Fdir1%2Fdir2 MODIFY root%2Ftest2 DELETE root%2Ftest1 [root@georep1 ~]# Delete: ======= [root@georep1 ~]# cat /root/log1 DELETE root%2Fdir1%252Fdir2 [root@georep1 ~]# [root@georep1 ~]# cat /root/log1 DELETE %2Fmnt%2Fglusterfs%2Fdir1 [root@georep1 ~]# Moving the bug to verified state
Saravana, Please review and sign-off the edited doc text.
doctext looks fine for me.
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-1845.html