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.
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.
- If you initiate the GetObject request to a delete marker, no content can be returned because a delete marker does not store data. 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.
- Users who have only the
oss:DeleteObjectVersion
permission can perform only 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. If you do not specify the version ID of the object that you want to delete in the DeleteObject request, Object Storage Service (OSS) assigns a delete marker to the object as its current version instead of deleting the object.
Remove delete markers
The following section describes how to remove delete markers for a versioning-enabled bucket:
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.