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 any other object, but differs from other objects in the following ways:

  • A delete marker does not store data.
  • A delete marker has no 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.
  • Only the DeleteObject operation can be performed on a delete marker. Only accounts that have the DeleteObjectVersion permission can remove a delete marker.

A delete marker is generated when you initiate the DeleteObject request to an object in a bucket that has versioning enabled or suspended. If you do not specify the version ID of the object that you want to delete in the DeleteObject request, OSS assigns a delete marker to the object as its current version instead of deleting the object.

Note You cannot directly delete objects in a bucket that has versioning enabled. The delete marker makes OSS behave as if the object had been deleted.

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 the object that you want to delete in the DeleteObject request, OSS assigns a delete marker to the object as its current version instead of deleting the object. One object can have multiple delete markers. The following figure shows how the DeleteObject operation on a delete marker removes nothing, but assigns a new delete marker to a bucket.enable versioning one
Note In a versioning-enabled bucket, a delete marker corresponds to a unique version ID. Therefore, an object that has multiple versions can have multiple delete markers.
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. Version 222222 becomes the current version.enable versioning