A delete marker is a placeholder specified by the DeleteObject request. It is used to indicate that an object in a bucket that has versioning enabled or suspended is deleted. Knowledge of delete markers is beneficial for the effective management of versioning. Delete markers facilitate the proper handling of deleted objects, enabling accurate tracking and recovery of data.
Comparison with objects
A delete marker has an object name (or key) and version ID like an object, but differs from an object in the following aspects:
A delete marker does not store data.
A delete marker has no access control list (ACL) configured.
Given that no data is stored in delete markers, performing GetObject request will not result in the retrieval of any content. If you initiate the GetObject request to an object with a delete marker as its current version, 404 and the corresponding error message are returned.
Only users who have the
oss:DeleteObjectVersion
permission can perform delete operations on delete markers.
When you initiate the DeleteObject request to an object in a bucket that has versioning enabled or suspended, a delete marker is generated for the object. If you do not specify the version ID of the object to delete, Object Storage Service (OSS) assigns a delete marker to the object as its current version instead of deleting the object.
You cannot delete an object stored in a bucket that has versioning enabled. However, you can consider an object with a delete marker as a deleted object.
Remove delete markers
The following section describes how to remove delete markers for a versioning-enabled bucket:
If you do not specify the version ID of an object in the DeleteObject request, OSS assigns a new delete marker to the object as its current version. The following figure shows that an object can have multiple delete markers.
In a versioning-enabled bucket, an object can have multiple delete markers, and a delete marker corresponds to a unique version ID.
To permanently remove a delete marker, you must include its version ID in the DeleteObject request. The following figure shows how the DeleteObject request permanently removes a delete marker with the version ID of 333333. Then, version 222222 becomes the current version of the object.
You can use the following OSS SDKs for different programming languages to delete a specific version of an object and the delete marker of the object: Java SDK, Python SDK, PHP SDK, Node.js SDK, .NET SDK, Go SDK, and C++ SDK.