s3gw-tech / s3gw

Container able to run on a Kubernetes cluster, providing S3-compatible endpoints to applications.
https://s3gw.tech
Apache License 2.0
127 stars 20 forks source link

Unversioned -> Versioned Bucket Transition - Null Versions #687

Open irq0 opened 1 year ago

irq0 commented 1 year ago

S3 demands that all objects created in an unversioned bucket will have the "null" version id / instance after a bucket becomes versioned.

From https://docs.aws.amazon.com/AmazonS3/latest/userguide/Versioning.html

Objects that are stored in your bucket before you set the versioning state have a version ID of null

Since we treat unversioned as a special case of versioned buckets, we have unique version ids even for unversioned. In practice this means, that after switching on versioning a user can't address existing objects under the version id "null".

A simple way to be more like S3 would be to set all version ids to "null" on the unversioned -> versioned transition.

S3 tests:

test_versioning_obj_plain_null_version_overwrite
test_versioning_obj_plain_null_version_removal
jecluis commented 11 months ago

I think this needs to be addressed after v0.23.0. I suspect this will require a non-trivial effort.

I believe we will have to document missing this transition in the support matrix, along with suspended versioning.