[swift] Object Versioning: How to retrieve old versions of deleted objects?

Bernd Bausch berndbausch at gmail.com
Sun May 31 07:46:06 UTC 2020


I'd like to delete the attached email, but it's not possible. Sorry. I 
did not see that the object version that I tried to retrieve had a 
content type of "application/x-deleted;swift_versions_deleted=1". That 
explains the behaviour.

Bernd.

On 5/31/2020 4:33 PM, Bernd Bausch wrote:
>
> According to documentation of Swift's new object versioning middleware 
> [1], a deleted object won't be visible but previous version content is 
> still recoverable.
>
> Documentation doesn't say how, though. After deleting /myobject/, I 
> can see its versions:
>
> $ openstack object delete testcontainer myobject
> $ curl http://192.168.1.200:8080/v1/$ACCOUNT/testcontainer?versions -H 
> "x-auth-token: $T" | python -m json.tool | grep -e version_id -e name
>         "name": "myobject",
>         "version_id": "1590896642.07497"
>         "name": "myobject",
>         "version_id": "1590892906.83929"
>         "name": "myobject",
>         "version_id": "1590892899.36921"
>
> But I can't GET old versions of /myobject/:
>
> $ curl -i 
> http://192.168.1.200:8080/v1/$ACCOUNT/testcontainer/myobject?version-id="1590896642.07497" 
> -H "x-auth-token: $T"
> HTTP/1.1 404 Not Found
>
> After creating another object with the same name /myobject/, old 
> versions are accessible again. This is a solution, but dare I say not 
> a very elegant one. *Can **a deleted, versioned object be recovered 
> without creating a dummy object with the same name?*
>
> [1] 
> https://docs.openstack.org/swift/latest/middleware.html#object-crud-operations-to-a-versioned-container
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20200531/71c26b2a/attachment.html>


More information about the openstack-discuss mailing list