swift container retention

Geert Geurts geert.geurts at linuxfabrik.ch
Sun May 28 12:13:32 UTC 2023


Hallo,

I've gotten the assignment to implement a backup solution using openstack swift containers.
What we want is that the files of customers are kept in the customers own container and for those files to retain their versions on updates of the file.
So far so good, this is all possible, and extensively documented online. Now, the second part is more complicated it appears where I thougth this would be a quite common usage example of object
storage.
I cannot find how I can automagically delete versions of files that are older then X days. There is the X-delete-after header, but this header needs to be added for each transaction. What I want is
for all objects in a container to get deleted after X days without having to add a header once the object is uploaded.
Does anyone have suggestions on how I could implement this requirement?

Please find below a grafical repesentation of what I want

    Versioning disabled

Automated add headers delete-after           Versioning enabled

   Usage on the account of LF            Usage on the account of client
            │                                         │
            │                                         │
            │                                         │
            ▼                                         ▼
 ┌────────────────────────┐             ┌────────────────────────┐
 │                        │             │                        │
 │  Versions-container    │             │  Current-container     │
 │                        │             │                        │
 ├────────────────────────┤             ├────────────────────────┤
 │                        │             │                        │
 │File1 v123456           │             │ File1                  │
 │File1 v567899           │             │ File2                  │
 │                        │             │ File3                  │
 │File3 v234567           │             │ ...                    │
 │                        │             │ FileN                  │
 └────────────────────────┘             └─────────────┬──────────┘
             ▲                                        │
             │                                        │
             └────────────────────────────────────────┘

    Modifications cause current to be moved to Versioned-container

Best regards,
Geert


More information about the openstack-discuss mailing list