Bug 1241385 - [Backup]: Glusterfind pre attribute '--output-prefix' not working as expected in case of DELETEs
Summary: [Backup]: Glusterfind pre attribute '--output-prefix' not working as expected...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: glusterfind
Version: rhgs-3.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: RHGS 3.1.1
Assignee: Saravanakumar
QA Contact: Rahul Hinduja
URL:
Whiteboard:
Depends On: 1244144 1257141
Blocks: 1216951 1223636 1251815
TreeView+ depends on / blocked
 
Reported: 2015-07-09 07:03 UTC by Sweta Anandpara
Modified: 2016-09-17 15:20 UTC (History)
12 users (show)

Fixed In Version: glusterfs-3.7.1-14
Doc Type: Bug Fix
Doc Text:
Previously, the attribute '--output-prefix' specified in 'glusterfind pre' command did not provide the output prefix in case of deleted entry present in the glusterfind output file. With the fix, the output prefix of the deleted entry is present in the glusterfind output file.
Clone Of:
: 1244144 (view as bug list)
Environment:
Last Closed: 2015-10-05 07:18:57 UTC
Embargoed:
sarumuga: needinfo+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1845 0 normal SHIPPED_LIVE Moderate: Red Hat Gluster Storage 3.1 update 2015-10-05 11:06:22 UTC

Description Sweta Anandpara 2015-07-09 07:03:02 UTC
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]#

Comment 3 monti lawrence 2015-07-22 21:14:24 UTC
Doc text is edited. Please sign off to be included in Known Issues.

Comment 5 Sweta Anandpara 2015-07-27 06:21:32 UTC
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.

Comment 7 Sweta Anandpara 2015-07-28 04:45:07 UTC
Have edited the doc text.

Comment 9 Sweta Anandpara 2015-07-28 06:38:54 UTC
I am affirmative!

Comment 12 Aravinda VK 2015-08-18 09:45:23 UTC
Patch posted upstream http://review.gluster.org/#/c/11712/

Comment 13 Aravinda VK 2015-08-27 10:45:41 UTC
Downstream patch https://code.engineering.redhat.com/gerrit/#/c/56398/

Comment 14 Rahul Hinduja 2015-09-06 08:47:25 UTC
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

Comment 15 Divya 2015-09-22 06:36:58 UTC
Saravana,

Please review and sign-off the edited doc text.

Comment 16 Saravanakumar 2015-09-24 06:31:54 UTC
doctext looks fine for me.

Comment 18 errata-xmlrpc 2015-10-05 07:18:57 UTC
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


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