Bug #80325
closedrgw: conditional writes on a versioning-suspended bucket see the delete marker as the current object
0%
Description
After deleting an object in a bucket with versioning suspended, RGW treats the remaining delete marker as an existing object when checking `If-Match` and `If-None-Match` on `PutObject` and `CompleteMultipartUpload`. This prevents create-only writes from recreating the object, while allowing `If-Match: *` writes to succeed even though the object is deleted. Unversioned buckets and buckets with versioning enabled behave correctly.
AWS documents [1] that when the current version is a delete marker, `If-None-Match: *` should succeed and `If-Match` should return `404 Not Found`. A DELETE with versioning suspended [2] leaves a delete marker with version ID `null`, so the same behavior should apply here.
To reproduce, create a bucket, enable versioning, then suspend it:
PUT obj DELETE obj -> delete marker with version ID null HEAD obj -> HTTP 404 ListObjectsV2 -> 0 keys
Run each conditional write independently against the deleted key, repeating the setup between tests:
PUT obj If-None-Match: * Actual: HTTP 412 PreconditionFailed Expected: HTTP 200 PUT obj If-Match: * Actual: succeeds Expected: HTTP 404 NoSuchKey PUT obj If-Match: "badetag" Actual: HTTP 412 PreconditionFailed Expected: HTTP 404 NoSuchKey CompleteMultipartUpload If-None-Match: * Actual: HTTP 412 PreconditionFailed Expected: HTTP 200
[1] https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-writes.html
[2] https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjectsfromVersioningSuspendedBuckets.html
MH Updated by Matthew Heler 3 months ago
- Description updated (diff)
MH Updated by Matthew Heler 3 months ago
- Description updated (diff)
MH Updated by Matthew Heler 3 months ago
- Description updated (diff)
MH Updated by Matthew Heler 3 months ago
- Backport set to umbrella, tentacle, squid
MH Updated by Matthew Heler 3 months ago
- Pull request ID set to 71584
UB Updated by Upkeep Bot 2 months ago
- Copied to Backport #80787: tentacle: rgw: conditional writes on a versioning-suspended bucket see the delete marker as the current object added
UB Updated by Upkeep Bot 2 months ago
- Copied to Backport #80788: squid: rgw: conditional writes on a versioning-suspended bucket see the delete marker as the current object added
UB Updated by Upkeep Bot 2 months ago
- Copied to Backport #80789: umbrella: rgw: conditional writes on a versioning-suspended bucket see the delete marker as the current object added
UB Updated by Upkeep Bot 2 months ago
- Status changed from New to Backporting
- Merge Commit set to 6483a25aed8fae310512af1dc1cb621842091ca5
- Fixed In set to v21.3.0-3562-g6483a25aed
- Upkeep Timestamp set to 2026-09-23T11:14:02+00:00
KB Updated by Kyle Bader 2 months ago
- Related to Bug #80925: rgw: conditional writes in a versioning-enabled bucket are not atomic added
UB Updated by Upkeep Bot about 1 month ago
- Status changed from Backporting to Resolved
- Upkeep Timestamp changed from 2026-09-23T11:14:02+00:00 to 2026-10-21T01:42:03+00:00