About Delete Markers
When you delete an object contained in a bucket where versioning has been enabled, a delete marker is automatically created. In S3, a delete marker is a placeholder that signifies the object has been deleted without actually removing it from the bucket. Deleted or overwritten objects are considered noncurrent, meaning they are no longer the latest version but are still retained in the bucket’s version history.
Delete Marker Characteristics
A delete marker:
-
Replaces the current version of an object but has no associated data.
-
Has a size of 1 to 4 bytes per character in its key.
-
Has the same key as the object you deleted.
-
Has its own ID.
-
Has no related ACL.
-
Cannot be downloaded. If you try to download a delete marker, a
NoSuchKey
error message appears as the delete marker does not have associated data. -
Can only be deleted by the owner of the object.
A delete marker is not considered an object as it does not have any associated data. As a result, it is not displayed if you list the objects contained in your buckets. To get information about the versions and the delete markers of your objects, see Listing the Versions of an Object.
If several versions of a same object have been created using versioning, you thus need to delete each version one by one using their ID to completely delete the object. If you do not specify the version ID, a delete marker is created, replacing the current version of the object. If you delete an object without specifying its version ID and its current version is already a delete marker, a new delete marker is added in the bucket.
How To Remove a Delete Marker
To remove a delete marker, you must use the delete-object
command and specify the version-id
of the delete marker. For more information, see Removing Objects from a Bucket.
When you completely remove all delete markers, the last version of the object becomes the current version and is displayed when listing your objects. You can still download the previous versions of your objects. For more information, see Listing the Versions of an Object.
Related Pages