COPY with ranges

Bug #1521359 reported by John Dickinson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Won't Fix
Wishlist
Unassigned

Bug Description

send 1 or more ranges with a copy request that copies just those ranges of the source to the destination

Revision history for this message
Tim Burke (1-tim-z) wrote :
Download full text (4.0 KiB)

This already works for one range, right?

    $ curl -sv -H x-auth-token:$OS_AUTH_TOKEN $OS_STORAGE_URL/c/1range -X PUT -H x-copy-from:c/tox.ini -H range:bytes=0-10 -H content-length:0
    * Trying 192.168.8.80...
    * Connected to saio (192.168.8.80) port 8080 (#0)
    > PUT /v1/AUTH_test/c/1range HTTP/1.1
    > Host: saio:8080
    > User-Agent: curl/7.43.0
    > Accept: */*
    > x-auth-token:AUTH_tk21005e35147741cca1ac947e27172b69
    > x-copy-from:c/tox.ini
    > range:bytes=0-10
    > content-length:0
    >
    < HTTP/1.1 201 Created
    < Content-Length: 0
    < X-Object-Meta-Mtime: 1446154503.000000
    < X-Copied-From-Last-Modified: Tue, 22 Dec 2015 21:51:12 GMT
    < X-Copied-From: c/tox.ini
    < Last-Modified: Tue, 22 Dec 2015 21:54:00 GMT
    < Etag: f935b2c50837722c7a93aa48577ca146
    < X-Copied-From-Account: AUTH_test
    < Content-Type: text/html; charset=UTF-8
    < X-Trans-Id: tx16fd8a9ed5c4425381ddd-005679c677
    < Date: Tue, 22 Dec 2015 21:53:59 GMT
    <
    * Connection #0 to host saio left intact

    $ curl -sv -H x-auth-token:$OS_AUTH_TOKEN $OS_STORAGE_URL/c/1range
    * Trying 192.168.8.80...
    * Connected to saio (192.168.8.80) port 8080 (#0)
    > GET /v1/AUTH_test/c/1range HTTP/1.1
    > Host: saio:8080
    > User-Agent: curl/7.43.0
    > Accept: */*
    > x-auth-token:AUTH_tk21005e35147741cca1ac947e27172b69
    >
    < HTTP/1.1 200 OK
    < Content-Length: 11
    < X-Object-Meta-Mtime: 1446154503.000000
    < Last-Modified: Tue, 22 Dec 2015 21:54:00 GMT
    < Connection: close
    < Etag: f935b2c50837722c7a93aa48577ca146
    < X-Timestamp: 1450821239.57875
    < Date: Tue, 22 Dec 2015 21:54:11 GMT
    < Content-Type: application/octet-stream
    < X-Trans-Id: txaecde39127ee4800bb861-005679c683
    <
    [tox]
    * Closing connection 0
    minve

It kind of works for multiple ranges, too, but not in the way that a user might expect: the raw multipart MIME document gets written as the new object, with subsequent GETs responding 200 (rather than 206).

    $ curl -sv -H x-auth-token:$OS_AUTH_TOKEN $OS_STORAGE_URL/c/2ranges -X PUT -H x-copy-from:c/tox.ini -H range:bytes=0-10,5-10 -H content-length:0
    * Trying 192.168.8.80...
    * Connected to saio (192.168.8.80) port 8080 (#0)
    > PUT /v1/AUTH_test/c/2ranges HTTP/1.1
    > Host: saio:8080
    > User-Agent: curl/7.43.0
    > Accept: */*
    > x-auth-token:AUTH_tk21005e35147741cca1ac947e27172b69
    > x-copy-from:c/tox.ini
    > range:bytes=0-10,5-10
    > content-length:0
    >
    < HTTP/1.1 201 Created
    < Content-Length: 0
    < X-Object-Meta-Mtime: 1446154503.000000
    < X-Copied-From-Last-Modified: Tue, 22 Dec 2015 21:51:12 GMT
    < X-Copied-From: c/tox.ini
    < Last-Modified: Tue, 22 Dec 2015 21:54:41 GMT
    < Etag: 5d0c4072b5cfd909bf121e524106a6fb
    < X-Copied-From-Account: AUTH_test
    < Content-Type: text/html; charset=UTF-8
    < X-Trans-Id: tx12f9178a03134900b6d26-005679c6a0
    < Date: Tue, 22 Dec 2015 21:54:40 GMT
    <
    * Connection #0 to host saio left intact

    $ curl -sv -H x-auth-token:$OS_AUTH_TOKEN $OS_STORAGE_URL/c/2ranges
    * Trying 192.168.8.80...
    * Connected to saio (192.168.8.80) port 8080 (#0)
    > GET ...

Read more...

Revision history for this message
John Dickinson (notmyname) wrote :

Right. The "wishlist" thing here is that I can grab a few different ranges and create a new object out of them.

Thoughts (in no real order):

 * Maybe this is a breaking change since the old-style multipart mime wouldn't be what's copied.
 * Maybe now that we have SLORanges, thats' the Way It Is To Be Done now. This would involve a second "squash" step if needed by the user.

If those are true (and I suspect they are), then this older wishlist thing could probably be closed with a "don't do it that way, here use this instead".

Revision history for this message
John Dickinson (notmyname) wrote :

linking to https://bugs.launchpad.net/swift/+bug/1467668 since it's a similar report (although not really a duplicate)

Changed in swift:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.