Bug 1263095

Summary: [BACKUP]: Output file for delete is misleading with the additional character %25
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Rahul Hinduja <rhinduja>
Component: glusterfindAssignee: Aravinda VK <avishwan>
Status: CLOSED CURRENTRELEASE QA Contact: Sweta Anandpara <sanandpa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rhgs-3.1CC: mchangir, rhs-bugs
Target Milestone: ---Keywords: ZStream
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-07 14:07:09 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 Rahul Hinduja 2015-09-15 06:42:59 UTC
Description of problem:
=======================

When we generate output file we convert "/" to %2F which is correctly working incase of NEW as:

[root@georep1 ~]# cat rh5.txt
NEW %2Fmnt%2Fglusterfs%2Ftesting
NEW %2Fmnt%2Fglusterfs%2Ftesting%2Fa
NEW %2Fmnt%2Fglusterfs%2Ftesting%2Ffile.1
NEW %2Fmnt%2Fglusterfs%2Ftesting%2Ffile.9
NEW %2Fmnt%2Fglusterfs%2Ftesting%2Ffile.6
NEW %2Fmnt%2Fglusterfs%2Ftesting%2Ffile.2
NEW %2Fmnt%2Fglusterfs%2Ftesting%2Ff8
NEW %2Fmnt%2Fglusterfs%2Ftesting%2Ff9

But incase of delete we add %252F for "/" as:


[root@georep1 ~]# cat rh6.txt
DELETE %2Fmnt%2Fglusterfs%2Ftesting%252Ffile.9
DELETE %2Fmnt%2Fglusterfs%2Ftesting%252Ff9
[root@georep1 ~]#

If you consume these log file for backup, the deletes will not provide the actual path and it will error as "no such file or directory"

Example for conversion:
=======================

bash-4.3$ python
Python 2.7.8 (default, Apr 15 2015, 09:26:43) 
[GCC 4.9.2 20150212 (Red Hat 4.9.2-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib
>>> li = [urllib.unquote('%2Fmnt%2Fglusterfs%2Ftesting%252Ffile.9')]
>>> li
['/mnt/glusterfs/testing%2Ffile.9']
>>> li = [urllib.unquote_plus('%2Fmnt%2Fglusterfs%2Ftesting%252Ffile.9')]
>>> li
['/mnt/glusterfs/testing%2Ffile.9']
>>> li = [urllib.unquote_plus('%2Fmnt%2Fglusterfs%2Ftesting%2Ffile.9')]
>>> li
['/mnt/glusterfs/testing/file.9']
>>> 


The convention used for NEW entry is successfully converted into path, but the convention used for DELETE needs to unquote twice to get the list. 


Version-Release number of selected component (if applicable):
=============================================================

glusterfs-3.7.1-14.el7rhgs.x86_64


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

Always


Steps to Reproduce:
===================
1. Create glusterfind session
2. Create directory and file inside it
3. Generate output file {glusterfind pre}
4. Glusterfind post
5. Delete the file created at step 2
6. Generate output file {glusterfind pre}
7. Observe the convention used for NEW at step 3 vs DELETE at step 6

Actual results:
For NEW:
=======
NEW %2Fmnt%2Fglusterfs%2Ftesting%2Ffile.9

For DELETE:
===========
DELETE %2Fmnt%2Fglusterfs%2Ftesting%252Ffile.9


Expected results:

For NEW:
=======
NEW %2Fmnt%2Fglusterfs%2Ftesting%2Ffile.9

For DELETE:
===========
DELETE %2Fmnt%2Fglusterfs%2Ftesting%2Ffile.9