A bucket has S3 Versioning enabled and contains a single object with two versions. An application issues a `DELETE` request for that object's key without specifying a version ID. What happens, and what does a subsequent plain `GET` request (also without a version ID) return?
- Both versions are permanently deleted immediately; the GET returns a 404
- S3 inserts a new delete marker as the current version; the GET returns a 404 Not Found
- The most recent version is permanently deleted, leaving the older version as current; the GET returns that older version's data
- The DELETE request is rejected because a version ID must be specified in a versioning-enabled bucket
Why B? And why not the others?
Correct answer: B. S3 inserts a new delete marker as the current version; the GET returns a 404 Not Found
In a versioning-enabled bucket, a simple DELETE request, meaning one that does not specify a version ID, does not remove any existing object data at all. Instead, Amazon S3 inserts a delete marker, which becomes the new current version of that key. A delete marker has no data associated with it, so a subsequent GET request that also omits a version ID sees the delete marker as the current version and returns a 404 Not Found response (along with an `x-amz-delete-marker: true` header), even though every prior version, including the one that was current before the DELETE, is still fully intact and can be retrieved by requesting it with its specific version ID. The option describing both versions as permanently deleted immediately is wrong because no data is destroyed by a version-less DELETE; that is precisely the safety behaviour versioning is designed to provide. The option describing only the most recent version being permanently deleted, exposing the older version as current, describes what would happen only if the DELETE request had specified that most recent version's ID explicitly, which is a fundamentally different, irreversible operation from the version-less DELETE described here. The option claiming the DELETE is rejected is wrong because S3 never requires a version ID on a DELETE request; omitting it is a fully valid, and in fact the most common, way to delete an object in a versioned bucket, precisely because it is non-destructive.
Source: AWS S3 documentation: Working with delete markers — a simple DELETE without a version ID inserts a delete marker as the current version, and GET without a version ID returns a 404 when the current version is a delete marker