Updated on 2024-01-02 GMT+08:00

Managing Fragments

Scenarios

Fragments refer to incomplete data in a bucket. Data is uploaded to OBS in multipart mode. In the following common and other scenarios, an upload fails and fragments are generated. You need to clear these fragments to free up storage space.

  • The network is in poor conditions, and the connection to the OBS server is interrupted frequently.
  • The upload task is manually suspended.
  • The device is faulty.
  • The device is powered off suddenly.

Fragments in OBS consume storage space and are billed based on price rates of storage space. If fragments are generated due to interruptions or failures of multipart upload tasks, you can resume such tasks so that fragments will be cleared, or you can directly clear the fragments to save storage space.

For details about how to manage fragments, see How Do I Manage Fragments?

  • If a bucket fails to be deleted, check whether all fragments have been deleted. If not, delete all fragments from the bucket.
  • If no object exists in the bucket but the fee is still being deducted, check whether there are fragments in the bucket. If yes, delete the fragments to reduce storage costs.

How to Use

Table 1 Methods for deleting fragments

Tool

Method

OBS Console

OBS Console allows you to batch delete all selected fragments with one click.

For details, see Managing Fragments.

OBS Browser+

You can delete all of the selected fragments in a bucket in a batch. Alternatively, you can click Delete All above the list to delete all fragments.

obsutil

With obsutil, you can delete the failed or interrupted multipart upload task to delete fragments generated by the task. If a bucket has more than one multipart upload tasks, you need to delete all the multipart upload tasks to delete all fragments in the bucket.

For details, see Deleting a Multipart Upload Task.

API

You can delete fragments from a bucket through the following procedure:

  1. Use the Listing Initiated Multipart Uploads in a Bucket operation to list all the multipart upload tasks and obtain their upload IDs.
  2. Use the Canceling a Multipart Upload Task operation to cancel the multipart upload tasks. After these tasks are canceled, all fragments generated by them can be deleted.

SDKs

With OBS SDK, fragments are generated when parts of a multipart task are not merged. You can cancel the task to delete generated fragments. The procedure is as follows:

  1. Use the ObsClient.listMultipartUploads interface to list all multipart upload tasks and obtain their UploadId.
  2. Use the ObsClient.abortMultipartUpload interface to cancel the multipart upload task so that the generated fragments will be cleared.