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.

Note 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 a delete marker of an object in the DeleteObject request, OSS does not remove the delete marker but assigns a new delete marker to the object as the current version of the object. The following figure shows that an object can have multiple delete markers. enable versioning one
Note 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. enable versioning

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.