Project

General

Profile

Bug #10666

RGW swift API: Response header of GET request for container does not contain X-Container-Object-Count, X-Container-Bytes-Used and x-trans-id headers

Added by Ahmad Faheem about 9 years ago. Updated almost 9 years ago.

Status:
Resolved
Priority:
Normal
Target version:
-
% Done:

0%

Source:
Q/A
Tags:
Backport:
hammer
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

In swift response returned by GET on container:
curl -i http://10.0.2.15:8080/v1/AUTH_b2419ea9588d49ddbd8c006b5eb199ff/container -X GET -H "X-Auth-Token: 1bdd9fd9c40845a3b4efb81d5d93abe3"

HTTP/1.1 200 OK
Content-Length: 29
X-Container-Object-Count: 5
Accept-Ranges: bytes
X-Storage-Policy: Policy-0
X-Container-Meta-Quota-Count: 10
X-Container-Bytes-Used: 2097158
X-Timestamp: 1422385210.05485
Content-Type: text/plain; charset=utf-8
X-Trans-Id: txc8180b27ba9243a2a99ec-0054c82ceb
Date: Wed, 28 Jan 2015 00:27:23 GMT

response returned by rgw:
curl -i https://10.20.20.15:80/swift/v1/container -X GET -H "X-Auth-Token: c12140163cce491e9aed7165796f1f02"

HTTP/1.1 200 OK
Date: Wed, 28 Jan 2015 10:29:00 GMT
Server: Apache/2.4.7 (Ubuntu)
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Content-Type: application/octet-stream
Connection: close
Transfer-Encoding: chunked

Associated revisions

Revision d3a3d5ae (diff)
Added by Dmytro Iurchenko about 9 years ago

rgw: Swift API. Complement the response to "show container details"

OpenStack Object Storage API v1 states that X-Container-Object-Count, X-Container-Bytes-Used and user-defined metadata headers should be included in a response.

Fixes: #10666
Backport: hammer
Reported-by: Ahmad Faheem <>
Reviewed-by: Yehuda Sadeh <>
Signed-off-by: Dmytro Iurchenko <>

Revision c87aa110 (diff)
Added by Dmytro Iurchenko almost 9 years ago

rgw: Swift API. Complement the response to "show container details"

OpenStack Object Storage API v1 states that X-Container-Object-Count, X-Container-Bytes-Used and user-defined metadata headers should be included in a response.

Fixes: #10666
Backport: hammer
Reported-by: Ahmad Faheem <>
Reviewed-by: Yehuda Sadeh <>
Signed-off-by: Dmytro Iurchenko <>
(cherry picked from commit d3a3d5ae5859cd7f2eed307e8f942f9a9fd75f35)

History

#1 Updated by Dmytro Yurchenko about 9 years ago

  • Assignee set to Dmytro Yurchenko

#3 Updated by Yehuda Sadeh about 9 years ago

Note pull request 3612: https://github.com/ceph/ceph/pull/3612. We shouldn't do duplicate work.

#4 Updated by Dmytro Yurchenko about 9 years ago

  • Status changed from New to In Progress

The issues are very alike but not the same.

#5 Updated by Dmytro Yurchenko about 9 years ago

I had some doubts if such query parameters as 'prefix' affect the headers like 'X-Container-Object-Count', because the docs are not clear.
I thought it is possible that Swift returns the amount of objects retrieved in response and in 'X-Container-Bytes-Used' could be a sum of their sizes.
But tests showed that these headers should not be affected by query parameters:

curl -i "http://172.16.0.2:8080/v1/AUTH_f76a8a92c0ad49c2809195ffcb6582c9/cont1" -X GET

HTTP/1.1 200 OK
Content-Length: 31
X-Container-Object-Count: 3
Accept-Ranges: bytes
X-Storage-Policy: Policy-0
X-Container-Bytes-Used: 3782499
X-Timestamp: 1423824771.91127
Content-Type: text/plain; charset=utf-8
X-Trans-Id: txb257f9a142b84d6997e17-0054dddd3f
Date: Fri, 13 Feb 2015 11:17:19 GMT

pic1.jpg
space1.jpg
space2.jpg

curl -i "http://172.16.0.2:8080/v1/AUTH_f76a8a92c0ad49c2809195ffcb6582c9/cont1? prefix=space " -X GET

HTTP/1.1 200 OK
Content-Length: 22
X-Container-Object-Count: 3
Accept-Ranges: bytes
X-Storage-Policy: Policy-0
X-Container-Bytes-Used: 3782499
X-Timestamp: 1423824771.91127
Content-Type: text/plain; charset=utf-8
X-Trans-Id: tx5825425c47d340cf90305-0054dddd83
Date: Fri, 13 Feb 2015 11:18:27 GMT

space1.jpg
space2.jpg

#6 Updated by Dmytro Yurchenko about 9 years ago

  • Status changed from In Progress to Fix Under Review

Wait for the review https://github.com/ceph/ceph/pull/3740 (closed)
x-trans-id fell out of the scope as I think it deserves a separate ticket.

#7 Updated by Yehuda Sadeh about 9 years ago

  • Status changed from Fix Under Review to Pending Backport
  • Backport set to hammer

#8 Updated by Loïc Dachary almost 9 years ago

  • Regression set to No
  • master commit:d3a3d5ae

#10 Updated by Loïc Dachary almost 9 years ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF