Project

General

Profile

Bug #19213

GET on SLO Object uploaded without etags and size_bytes keys in manifest fails

Added by Rajath Shashidhara about 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

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

Description

etags and size_bytes keys are optional (https://docs.openstack.org/developer/swift/overview_large_objects.html)
SLO upload and retrieval must work without these attributes. Here is an experiment

$ export OS_AUTH_TOKEN=AUTH_tkXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
$ echo "1-------1" >test.obj-1
$ echo "2-------2" >test.obj-2
$ echo "3-------3" >test.obj-3
$ curl -i -X GET -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/
HTTP/1.1 200 OK
X-Timestamp: 1488891360.44910
X-Account-Container-Count: 2
X-Account-Object-Count: 1
X-Account-Bytes-Used: 357
X-Account-Bytes-Used-Actual: 4096
X-Account-Access-Control: {}
X-Trans-Id: tx00000000000000000003a-0058beade0-1009-default
Content-Type: text/plain; charset=utf-8
Content-Length: 13
Date: Tue, 07 Mar 2017 12:56:00 GMT

container
seg
$ cat >manifest <<EOF                                                                                  
[
    {
        "path": "seg/test.obj-1" 
    },
    {
        "path": "seg/test.obj-2" 
    },
    {
        "path": "seg/test.obj-3" 
    }
]
EOF
$ curl -i -X PUT -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/seg/test.obj-1 -T test.obj-1
HTTP/1.1 100 CONTINUE

HTTP/1.1 201 Created
etag: 8894928dc692a8cbcd48e6900730d731
Last-Modified: Tue, 07 Mar 2017 12:57:31 GMT
X-Trans-Id: tx00000000000000000003b-0058beae3b-1009-default
Content-Type: text/plain; charset=utf-8
Content-Length: 0
Date: Tue, 07 Mar 2017 12:57:31 GMT

$ curl -i -X PUT -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/seg/test.obj-2 -T test.obj-2
HTTP/1.1 100 CONTINUE

HTTP/1.1 201 Created
etag: 50b7173d9985fcefedb85c3eb06576a0
Last-Modified: Tue, 07 Mar 2017 12:57:43 GMT
X-Trans-Id: tx00000000000000000003c-0058beae47-1009-default
Content-Type: text/plain; charset=utf-8
Content-Length: 0
Date: Tue, 07 Mar 2017 12:57:43 GMT

$ curl -i -X PUT -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/seg/test.obj-3 -T test.obj-3
HTTP/1.1 100 CONTINUE

HTTP/1.1 201 Created
etag: 3cdc2a371243b870ed4691e7308deda8
Last-Modified: Tue, 07 Mar 2017 12:57:51 GMT
X-Trans-Id: tx00000000000000000003d-0058beae4f-1009-default
Content-Type: text/plain; charset=utf-8
Content-Length: 0
Date: Tue, 07 Mar 2017 12:57:51 GMT

$ curl -i -X PUT -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/container/test.obj?multipart-manifest=put -T manifest
HTTP/1.1 100 CONTINUE

HTTP/1.1 201 Created
ETag: "d41d8cd98f00b204e9800998ecf8427e" 
Last-Modified: Tue, 07 Mar 2017 12:58:01 GMT
X-Trans-Id: tx00000000000000000003e-0058beae59-1009-default
Content-Type: text/plain; charset=utf-8
Content-Length: 0
Date: Tue, 07 Mar 2017 12:58:01 GMT

$ curl -i -X GET -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/container/test.obj
Date: Tue, 07 Mar 2017 12:58:13 GMT

$ curl -i --head -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/container/test.obj
curl: (8) Weird server reply
$ curl -i --head -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/container/test.obj
curl: (8) Weird server reply

$ curl -i -X DELETE -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/container/test.obj
HTTP/1.1 204 No Content
X-Trans-Id: tx000000000000000000041-0058beaedd-1009-default
Content-Type: text/plain; charset=utf-8
Date: Tue, 07 Mar 2017 13:00:13 GMT

$ cat >manifest <<EOF
[
    {
        "path": "seg/test.obj-1",
        "etag": "8894928dc692a8cbcd48e6900730d731",
        "size_bytes": 10
    },
    {
        "path": "seg/test.obj-2",
        "etag": "50b7173d9985fcefedb85c3eb06576a0",
        "size_bytes": 10
    },
    {
        "path": "seg/test.obj-3",
        "etag": "3cdc2a371243b870ed4691e7308deda8",
        "size_bytes": 10
    }
]
EOF

$ curl -i -X PUT -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/container/test.obj?multipart-manifest=put -T manifest
HTTP/1.1 100 CONTINUE

HTTP/1.1 201 Created
ETag: "4bcd295dd12750bfce08aebbcdab7fdc" 
Last-Modified: Tue, 07 Mar 2017 13:00:41 GMT
X-Trans-Id: tx000000000000000000042-0058beaef9-1009-default
Content-Type: text/plain; charset=utf-8
Content-Length: 0
Date: Tue, 07 Mar 2017 13:00:42 GMT

$ curl -i -X GET -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/container/test.obj                        
HTTP/1.1 200 OK
Content-Length: 30
Accept-Ranges: bytes
Last-Modified: Tue, 07 Mar 2017 13:00:41 GMT
X-Timestamp: 1488891641.83932
X-Static-Large-Object: True
ETag: "4bcd295dd12750bfce08aebbcdab7fdc" 
X-Object-Meta-Static-Large-Object:  True
X-Trans-Id: tx000000000000000000043-0058beaefd-1009-default
Content-Type: binary/octet-stream
Date: Tue, 07 Mar 2017 13:00:45 GMT

1-------1
2-------2
3-------3

$ curl -i -X DELETE -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/container/test.obj                        
HTTP/1.1 204 No Content
X-Trans-Id: tx000000000000000000044-0058beaf5c-1009-default
Content-Type: text/plain; charset=utf-8
Date: Tue, 07 Mar 2017 13:02:20 GMT

$ cat >manifest <<EOF
[
    {
        "path": "seg/test.obj-1",
        "etag": "8894928dc692a8cbcd48e6900730d731"        
    },
    {
        "path": "seg/test.obj-2",
        "etag": "50b7173d9985fcefedb85c3eb06576a0"        
    },
    {
        "path": "seg/test.obj-3",
        "etag": "3cdc2a371243b870ed4691e7308deda8" 
    }
]
EOF

$ curl -i -X PUT -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/container/test.obj?multipart-manifest=put -T manifest
HTTP/1.1 100 CONTINUE

HTTP/1.1 201 Created
ETag: "4bcd295dd12750bfce08aebbcdab7fdc" 
Last-Modified: Tue, 07 Mar 2017 13:03:05 GMT
X-Trans-Id: tx000000000000000000045-0058beaf89-1009-default
Content-Type: text/plain; charset=utf-8
Content-Length: 0
Date: Tue, 07 Mar 2017 13:03:05 GMT

$ curl -i -X GET -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/container/test.obj                        
Date: Tue, 07 Mar 2017 13:03:09 GMT

$ curl -i --head -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/container/test.obj                        
curl: (8) Weird server reply

$ curl -i -X DELETE -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/container/test.obj                        
HTTP/1.1 204 No Content
X-Trans-Id: tx000000000000000000048-0058beb016-1009-default
Content-Type: text/plain; charset=utf-8
Date: Tue, 07 Mar 2017 13:05:26 GMT

$ cat >manifest <<EOF
[
    {
        "path": "seg/test.obj-1",
        "size_bytes": 10
    },
    {
        "path": "seg/test.obj-2",
        "size_bytes": 10
    },
    {
        "path": "seg/test.obj-3",
        "size_bytes": 10
    }
]
EOF

$ curl -i -X PUT -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/container/test.obj?multipart-manifest=put -T manifest
HTTP/1.1 100 CONTINUE

HTTP/1.1 201 Created
ETag: "d41d8cd98f00b204e9800998ecf8427e" 
Last-Modified: Tue, 07 Mar 2017 13:06:18 GMT
X-Trans-Id: tx000000000000000000049-0058beb04a-1009-default
Content-Type: text/plain; charset=utf-8
Content-Length: 0
Date: Tue, 07 Mar 2017 13:06:18 GMT

$ curl -i -X GET -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/container/test.obj                        
HTTP/1.1 412 Precondition Failed
Content-Length: 18
X-Trans-Id: tx00000000000000000004a-0058beb04f-1009-default
Accept-Ranges: bytes
Content-Type: text/plain; charset=utf-8
Date: Tue, 07 Mar 2017 13:06:23 GMT

$ curl -i --head -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8000/swift/v1/container/test.obj                        
HTTP/1.1 412 Precondition Failed
Content-Length: 18
X-Trans-Id: tx00000000000000000004b-0058beb054-1009-default
Accept-Ranges: bytes
Content-Type: text/plain; charset=utf-8
Date: Tue, 07 Mar 2017 13:06:28 GMT

Also available in: Atom PDF