[Openstack] Object versioning not working

Clay Gerrard clay.gerrard at gmail.com
Mon Sep 16 20:43:48 UTC 2013


If you look at the raw API response from a HEAD on the "testing" container
(maybe with curl) I think you'll see that you've set the wrong metadata key.

You should set "X-Version-Location: test_cont" instead of
"X-Container-Meta-X-Version-Location: test_cont"

The `-m` option for `swift post` is only for setting user metadata;
unfortunately it doesn't look like you can set arbitrary headers with
`swift post`:

https://bugs.launchpad.net/swift/+bug/1226256

I did this:

curl -H 'x-auth-token: <your-auth-token-goes-here>'
http://localhost:8080/v1/AUTH_test/testing -X POST -H 'x-versions-location:
test_cont'

-Clay



On Mon, Sep 16, 2013 at 6:12 AM, Raghavendra Rangrej <rrrangrej at yahoo.com>wrote:

> Hi,
>
> I am trying swift object versioning using swift CLIs (using swift post to
> change meta data).
> In container-server.conf, I have set the flag allow_versions = true.
>
> With CLI, I added meta data as follows:
>
>  swift stat testing
>   Account: AUTH_1335922166fb4c43a4929f4fba670f3712dw
> Container: testing
>   Objects: 3
>     Bytes: 157
>  Read ACL: -v
> Write ACL:
>   Sync To:
>  Sync Key:
> Meta X-Versions-Location: test_cont
> Accept-Ranges: bytes
> X-Timestamp: 1379065681.40505
> Content-Type: text/plain; charset=utf-8
>
>
> swift stat test_cont
>   Account: AUTH_1335922166fb4c43a4929f4fba670f3712dw
> Container: test_cont
>   Objects: 3
>     Bytes: 42
>  Read ACL:
> Write ACL:
>   Sync To:
>  Sync Key:
> Accept-Ranges: bytes
> X-Timestamp: 1379066009.84224
> Content-Type: text/plain; charset=utf-8
>
> If I upload a new content of the object in testing container, I am
> expecting a version to be created in test_cont container.
> But it is not the case.
>
> I was expecting once the flag is set and meta data is changed, old
> versions should be stored in test_cont dirs but it is not the case
> Even swift restart didn't help.
>
> Any idea ? if my expectation is wrong or swift versioning has issues?
> I am using swift 1.4.0 version
>
> swift --version
> swift 1.4.0
>
> Thanks for your time
>
> Raghavendra
>
>
>
> _______________________________________________
> Mailing list:
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> Post to     : openstack at lists.openstack.org
> Unsubscribe :
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20130916/501eb938/attachment.html>


More information about the Openstack mailing list