Bug 1263095 - [BACKUP]: Output file for delete is misleading with the additional character %25
[BACKUP]: Output file for delete is misleading with the additional character %25
Status: NEW
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: glusterfind (Show other bugs)
3.1
x86_64 Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Aravinda VK
Sweta Anandpara
: ZStream
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-15 02:42 EDT by Rahul Hinduja
Modified: 2017-03-25 12:25 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
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)
Description Rahul Hinduja 2015-09-15 02:42:59 EDT
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

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