Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
This project is now read‑only. Starting Monday, February 2, please use https://ibm-ceph.atlassian.net/ for all bug tracking management.

Bug 1234644

Summary: rgw: swift api: using x-fresh-metadata=true in object copying using swift API copies custom metadata also
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Yehuda Sadeh <yehuda>
Component: RGWAssignee: Yehuda Sadeh <yehuda>
Status: CLOSED ERRATA QA Contact: ceph-qe-bugs <ceph-qe-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.3.0CC: cbodley, ceph-eng-bugs, flucifre, hyelloji, kbader, kdreyer, mbenjamin, owasserm, sweil, tmuthami
Target Milestone: rc   
Target Release: 1.3.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-16 22:20:17 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 Yehuda Sadeh 2015-06-22 22:43:06 UTC
Description of problem:
if x-fresh-metadata=true header is passed in object copying operation then the new object created should not contain the metadata of copied object. This is how swift behaves. But when the same header is used in ceph object storage using swift API it doesn't work. The same issue is observed whether using PUT and x-copy-from combination or COPY and destination header combination.


How reproducible:
always

Steps to Reproduce:
1. swift post container
2. curl -i https://object.jiocloud.com:80/swift/v1/container/file1 -X PUT -H "X-Auth-Token: b2ede42799494e18b00cc23c03f5d67f" -H "content-length:0" -d "" 
3. swift post container file1 -H "x-object-meta-testmeta: meta" 
4. swift stat container file1

Account: v1
Container: container
Object: file1
Content Type: application/octet-stream
Content Length: 0
Last Modified: Tue, 27 Jan 2015 06:53:47 GMT
ETag: d41d8cd98f00b204e9800998ecf8427e
Meta Testmeta: meta
Accept-Ranges: bytes
Server: Apache/2.4.7 (Ubuntu)
Connection: close

5. curl -i https://object.jiocloud.com:80/swift/v1/container/file2 -X PUT -H "X-Auth-Token: b2ede42799494e18b00cc23c03f5d67f" -H "x-copy-from: container/file1" -H "X-Fresh-Metadata: true"

HTTP/1.1 201 Created
Date: Tue, 27 Jan 2015 06:54:29 GMT
Server: Apache/2.4.7 (Ubuntu)
Content-Type: application/octet-stream
Connection: close
Transfer-Encoding: chunked

6. curl -i https://object.jiocloud.com:80/swift/v1/container/file2 -I -H "X-Auth-Token: b2ede42799494e18b00cc23c03f5d67f"

HTTP/1.1 200 OK
Date: Tue, 27 Jan 2015 06:55:05 GMT
Server: Apache/2.4.7 (Ubuntu)
Accept-Ranges: bytes
Last-Modified: Tue, 27 Jan 2015 06:54:29 GMT
etag: d41d8cd98f00b204e9800998ecf8427e
X-Object-Meta-testmeta: meta
Content-Type: application/octet-stream
Connection: close


Actual results:
old metadata still exists

Expected results:
old metadata shouldn't exist

Additional info:

Comment 4 Hemanth Kumar 2015-07-10 12:31:24 UTC
Hi Yehuda,

I am still seeing old metadata on the new objects..


Setup:-
Installed 1.3.0 (Cluster + rgw Client)
Populated few data on the Cluster.

Upgraded to async using the puddle repo(02-06)
Restarted Ceph process on all the Cluster Node and rgw Client (One at a time)

--------------------------------------------------------------------
Here is the updated Version.

On RGW Client.
--------------
[root@hp-ms-01-c25 ~]# rpm -qa | grep ceph
ceph-common-0.94.1-15.el7cp.x86_64
ceph-radosgw-0.94.1-15.el7cp.x86_64
[root@hp-ms-01-c25 ~]# 

On OSD's and MON.
-----------------
[root@gqac031 ~]# rpm -qa | grep ceph
ceph-0.94.1-15.el7cp.x86_64
ceph-common-0.94.1-15.el7cp.x86_64
ceph-osd-0.94.1-15.el7cp.x86_64
 
[root@gqas005 ~]# rpm -qa | grep ceph
ceph-common-0.94.1-15.el7cp.x86_64
ceph-mon-0.94.1-15.el7cp.x86_64
ceph-0.94.1-15.el7cp.x86_64

------------------------------------------------------------------------------
1. Creating a Container called Container.
-----------------------------------------
[root@hp-ms-01-c25 ~]# curl -i http://10.12.27.25/swift/v1/Container -X PUT -H "X-Auth-Token: AUTH_rgwtk0d00000068656d616e74683a737769667477a4d6063ec6ea666aeda05506eb7904846e1332cb9557dff7afa6045d928a8cfee70e68"
HTTP/1.1 201 Created
Content-type: text/plain; charset=utf-8
Content-Length: 0

[root@hp-ms-01-c25 ~]# curl -i http://10.12.27.25/swift/v1/Container -X GET -H "X-Auth-Token: AUTH_rgwtk0d00000068656d616e74683a737769667477a4d6063ec6ea666aeda05506eb7904846e1332cb9557dff7afa6045d928a8cfee70e68"
HTTP/1.1 204 No Content
Content-type: text/plain; charset=utf-8
Content-Length: 0

2. Created an Object.
---------------------
[root@hp-ms-01-c25 ~]# curl -i http://10.12.27.25/swift/v1/Container/File1 -X PUT -H "X-Auth-Token: AUTH_rgwtk0d00000068656d616e74683a737769667477a4d6063ec6ea666aeda05506eb7904846e1332cb9557dff7afa6045d928a8cfee70e68" -H "content-length:0" -d ""
HTTP/1.1 201 Created
etag: d41d8cd98f00b204e9800998ecf8427e
Content-type: text/plain; charset=utf-8
Content-Length: 0

3. Added a Custom Metadata.
---------------------------
[root@hp-ms-01-c25 ~]# curl -i http://10.12.27.25/swift/v1/Container/File1 -X POST -H "X-Auth-Token: AUTH_rgwtk0d00000068656d616e74683a737769667477a4d6063ec6ea666aeda05506eb7904846e1332cb9557dff7afa6045d928a8cfee70e68" -H "x-object-meta-testmeta: meta"
HTTP/1.1 202 Accepted
Content-type: text/plain; charset=utf-8
Content-Length: 0

4. Stat of the : File1
--------------------
[root@hp-ms-01-c25 ~]# swift -A http://10.12.27.25:80/auth/1.0 -U hemanth:swift -K 'vYwJa1H98e4g56PXJ0rIMW0ZFCqyzd0+WrFWennU' stat Container File1
       Account: v1
     Container: Container
        Object: File1
  Content Type: application/x-www-form-urlencoded
Content Length: 0
 Last Modified: Fri, 10 Jul 2015 10:27:04 GMT
          ETag: d41d8cd98f00b204e9800998ecf8427e
 Meta Testmeta: meta
 Accept-Ranges: bytes
    Connection: Keep-Alive
   X-Timestamp: 1436524024

5. Created a new File2 with X-Fresh-Metadata: true
--------------------------------------------------
[root@hp-ms-01-c25 ~]# curl -i http://10.12.27.25:80/swift/v1/Container/File2 -X PUT -H "X-Auth-Token: AUTH_rgwtk0d00000068656d616e74683a737769667477a4d6063ec6ea666aeda05506eb7904846e1332cb9557dff7afa6045d928a8cfee70e68" -H "x-copy-from: Container/File1" -H "X-Fresh-Metadata: true"
HTTP/1.1 201 Created
etag: d41d8cd98f00b204e9800998ecf8427e
Last-Modified: Fri, 10 Jul 2015 10:29:41 GMT
X-Copied-From: Container/File1
X-Copied-From-Account: hemanth
X-Copied-From-Last-Modified: Fri, 10 Jul 2015 10:27:04 GMT
Content-type: binary/octet-stream
Content-Length: 0

6. Check the Info of New File2.
-------------------------------
[root@hp-ms-01-c25 ~]# curl -i http://10.12.27.25:80/swift/v1/Container/File2 -I -H "X-Auth-Token: AUTH_rgwtk0d00000068656d616e74683a737769667477a4d6063ec6ea666aeda05506eb7904846e1332cb9557dff7afa6045d928a8cfee70e68"
HTTP/1.1 200 OK
Content-Length: 0
Accept-Ranges: bytes
Last-Modified: Fri, 10 Jul 2015 10:29:41 GMT
X-Timestamp: 1436524181
etag: d41d8cd98f00b204e9800998ecf8427e
X-Object-Meta-testmeta: meta
Content-type: application/x-www-form-urlencoded



====================================================
From the above step, the metadata info is still Seen
=====================================================

Checked the Infor of old File1.
---------------------------------
[root@hp-ms-01-c25 ~]# curl -i http://10.12.27.25:80/swift/v1/Container/File1 -I -H "X-Auth-Token: AUTH_rgwtk0d00000068656d616e74683a737769667477a4d6063ec6ea666aeda05506eb7904846e1332cb9557dff7afa6045d928a8cfee70e68"
HTTP/1.1 200 OK
Content-Length: 0
Accept-Ranges: bytes
Last-Modified: Fri, 10 Jul 2015 10:27:04 GMT
X-Timestamp: 1436524024
etag: d41d8cd98f00b204e9800998ecf8427e
X-Object-Meta-testmeta: meta
Content-type: application/x-www-form-urlencoded

Using swift stat , checked the info of both Old File1 and new File2
-------------------------------------------------------------------
[root@hp-ms-01-c25 ~]# swift -A http://10.12.27.25:80/auth/1.0 -U hemanth:swift -K 'vYwJa1H98e4g56PXJ0rIMW0ZFCqyzd0+WrFWennU' stat Container File2
       Account: v1
     Container: Container
        Object: File2
  Content Type: application/x-www-form-urlencoded
Content Length: 0
 Last Modified: Fri, 10 Jul 2015 10:29:41 GMT
          ETag: d41d8cd98f00b204e9800998ecf8427e
 Meta Testmeta: meta
 Accept-Ranges: bytes
    Connection: Keep-Alive
   X-Timestamp: 1436524181

[root@hp-ms-01-c25 ~]# swift -A http://10.12.27.25:80/auth/1.0 -U hemanth:swift -K 'vYwJa1H98e4g56PXJ0rIMW0ZFCqyzd0+WrFWennU' stat Container File1
       Account: v1
     Container: Container
        Object: File1
  Content Type: application/x-www-form-urlencoded
Content Length: 0
 Last Modified: Fri, 10 Jul 2015 10:27:04 GMT
          ETag: d41d8cd98f00b204e9800998ecf8427e
 Meta Testmeta: meta
 Accept-Ranges: bytes
    Connection: Keep-Alive
   X-Timestamp: 1436524024

===============================================================================

Tried again with another custom metadata input, Seeing the same issue.
----------------------------------------------
[root@hp-ms-01-c25 ~]# curl -i http://10.12.27.25/swift/v1/Container/File1 -X POST -H "X-Auth-Token: AUTH_rgwtk0d00000068656d616e74683a737769667477a4d6063ec6ea666aeda05506eb7904846e1332cb9557dff7afa6045d928a8cfee70e68" -H "x-object-meta-testmeta: Laptop"
HTTP/1.1 202 Accepted
Content-type: text/plain; charset=utf-8
Content-Length: 0

[root@hp-ms-01-c25 ~]# swift -A http://10.12.27.25:80/auth/1.0 -U hemanth:swift -K 'vYwJa1H98e4g56PXJ0rIMW0ZFCqyzd0+WrFWennU' stat Container File1
       Account: v1
     Container: Container
        Object: File1
  Content Type: application/x-www-form-urlencoded
Content Length: 0
 Last Modified: Fri, 10 Jul 2015 10:35:18 GMT
          ETag: d41d8cd98f00b204e9800998ecf8427e
 Meta Testmeta: Laptop
 Accept-Ranges: bytes
    Connection: Keep-Alive
   X-Timestamp: 1436524518

[root@hp-ms-01-c25 ~]# curl -i http://10.12.27.25:80/swift/v1/Container/File3 -X PUT -H "X-Auth-Token: AUTH_rgwtk0d00000068656d616e74683a737769667477a4d6063ec6ea666aeda05506eb7904846e1332cb9557dff7afa6045d928a8cfee70e68" -H "x-copy-from: Container/File1" -H "X-Fresh-Metadata: true"
HTTP/1.1 201 Created
etag: d41d8cd98f00b204e9800998ecf8427e
Last-Modified: Fri, 10 Jul 2015 10:35:44 GMT
X-Copied-From: Container/File1
X-Copied-From-Account: hemanth
X-Copied-From-Last-Modified: Fri, 10 Jul 2015 10:35:18 GMT
Content-type: binary/octet-stream
Content-Length: 0

[root@hp-ms-01-c25 ~]# swift -A http://10.12.27.25:80/auth/1.0 -U hemanth:swift -K 'vYwJa1H98e4g56PXJ0rIMW0ZFCqyzd0+WrFWennU' stat Container File3
       Account: v1
     Container: Container
        Object: File3
  Content Type: application/x-www-form-urlencoded
Content Length: 0
 Last Modified: Fri, 10 Jul 2015 10:35:44 GMT
          ETag: d41d8cd98f00b204e9800998ecf8427e
 Meta Testmeta: Laptop
 Accept-Ranges: bytes
    Connection: Keep-Alive
   X-Timestamp: 1436524544


[root@hp-ms-01-c25 ~]# curl -i http://10.12.27.25:80/swift/v1/Container/File1 -I -H "X-Auth-Token: AUTH_rgwtk0d00000068656d616e74683a737769667477a4d6063ec6ea666aeda05506eb7904846e1332cb9557dff7afa6045d928a8cfee70e68"
HTTP/1.1 200 OK
Content-Length: 0
Accept-Ranges: bytes
Last-Modified: Fri, 10 Jul 2015 10:35:18 GMT
X-Timestamp: 1436524518
etag: d41d8cd98f00b204e9800998ecf8427e
X-Object-Meta-testmeta: Laptop
Content-type: application/x-www-form-urlencoded

[root@hp-ms-01-c25 ~]# curl -i http://10.12.27.25:80/swift/v1/Container/File3 -I -H "X-Auth-Token: AUTH_rgwtk0d00000068656d616e74683a737769667477a4d6063ec6ea666aeda05506eb7904846e1332cb9557dff7afa6045d928a8cfee70e68"
HTTP/1.1 200 OK
Content-Length: 0
Accept-Ranges: bytes
Last-Modified: Fri, 10 Jul 2015 10:35:44 GMT
X-Timestamp: 1436524544
etag: d41d8cd98f00b204e9800998ecf8427e
X-Object-Meta-testmeta: Laptop
Content-type: application/x-www-form-urlencoded

Comment 5 Yehuda Sadeh 2015-07-10 19:44:24 UTC
Are you sure rgw was restarted following the upgrade?
I tested the version (built from source, not built packages) and it seem to work. This means that it's most likely either there's an issue with the built packages, or that rgw was not restarted. Can you verify the running rgw version by querying it through the admin socket?

Comment 6 Hemanth Kumar 2015-07-10 20:37:34 UTC
Seems to be working., 

I restarted all the Ceph process on Cluster Nodes and rgw Client once again..


Moving to verified state..

Comment 8 errata-xmlrpc 2015-07-16 22:20:17 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://access.redhat.com/errata/RHBA-2015:1240