Scenarios
Fragments are the incomplete data in buckets. When data is uploaded to OBS using a multipart upload, there will be fragments generated if the multipart upload fails because of the following and other possible causes:
- Frequent disconnections from the OBS server due to poor network conditions
- Manual upload interruptions
- Device failures
- Sudden power outages
Fragments generated from upload failures are stored in OBS. You can manually delete the fragments by following the instructions provided in this section. You can also resume the interrupted or failed multipart upload to remove the fragments.
- If there are fragments left in your bucket, your attempt to delete the bucket will fail. In such cases, delete all of the fragments first.
- The storage of fragments is billable. If your bucket has no objects but still generates costs, check for fragments and delete them if they exist.
Billing
You will be billed for storing fragments in OBS.
Manually Deleting Fragments
You can use OBS Console, APIs, SDKs, OBS Browser+, or obsutil to manually delete fragments.
Using OBS Console
- In the navigation pane of OBS Console, choose Buckets.
- In the bucket list, click the bucket you want to operate. The Objects page is displayed.
- Click Fragments, select the fragment that you want to delete, and click Delete on the right.
You can also select multiple fragments and click Delete above the fragment list to delete them in a batch.
- Click OK to confirm the deletion.
Figure 1 Deleting fragments
Using SDKs
With an OBS SDK, fragments are generated only when a multipart upload is not completed. You can delete the fragments by aborting the multipart upload. The procedure is as follows:
- Use the ObsClient.listMultipartUploads API to list all multipart uploads and obtain their upload IDs.
- Use the ObsClient.abortMultipartUpload API to abort all of the listed multipart uploads to delete all fragments.
Using the GUI Tool - OBS Browser+
- Log in to OBS Browser+.
- Select the bucket you want and click Fragments.
- In the Fragments window, select the unwanted fragments and click Delete above the list. You can also click Delete All above the list to delete all fragments. Click
in the upper right corner to refresh the fragment list, as shown in Figure 2.
Figure 2 Fragment management
- In the displayed Warning dialog box, confirm the delete information and click Yes.
- Click Yes.
The Fragments window is displayed. You can close this window to go back to the OBS Browser+ homepage.
Using the CLI Tool - obsutil
With obsutil, you can delete fragments by deleting the corresponding multipart upload. If a bucket has more than one multipart uploads, you need to delete all the multipart uploads to delete all fragments in the bucket.
For details, see Deleting a Multipart Upload.
Using a Lifecycle Rule to Automatically Delete Fragments
You can use OBS Console, APIs, or SDKs to define a lifecycle rule to automatically delete fragments.
Using OBS Console
- In the navigation pane of OBS Console, choose Buckets.
- In the bucket list, click the bucket you want to operate. The Objects page is displayed.
- In the navigation pane, choose Data Management > Lifecycle Rules.
- Click Create. The Create Lifecycle Rule dialog box is displayed.
- Configure the parameters listed in the following table as instructed. You can configure other parameters as needed by referring to Creating a Lifecycle Rule.

Table 1 Parameters under Basic Information
|
Parameter |
Example Value |
Description |
|
Status |
Enabled |
Whether to enable the lifecycle rule
- If Status is enabled, the lifecycle rule will be applied to affected objects as scheduled. The actions that can be triggered include storage class transitions, object deletion, fragment deletion, and removal of expired delete markers.
- If Status is disabled, the lifecycle rule will not be applied.
|
|
Rule Name |
rule-2aee |
The name of the lifecycle rule
A rule name:
- Can be up to 255 characters long.
- Can contain only uppercase letters, lowercase letters, digits, periods (.), underscores (_), and hyphens (-).
|
|
Scope |
All objects |
The scope of objects the lifecycle rule applies to
- Objects with specified prefix: The rule applies to the objects with the specified prefix in the bucket.
- All objects: The rule applies to all objects in the bucket.
Multiple lifecycle rules may overlap. In such cases, the overlapping must comply with the defined constraints. Otherwise, conflicting rules can cause the configuration to fail. |
|
Current Version |
Disabled |
Whether to enable settings for Current Version
- With Status enabled, you can add a maximum of four settings.
- With Status disabled, you do not need to make any settings.
|
|
Historical Version |
Disabled |
Whether to enable settings for Historical Version
- With Status enabled, you can add a maximum of four settings.
- With Status disabled, you do not need to make any settings.
|
|
Delete Fragments Upon Expiration |
Status: Enabled
30 days |
The number of days after which fragments will be deleted
- Status: whether to enable Delete Fragments Upon Expiration
- You can specify the number of days after which fragments in the bucket will be deleted.
|
- Select "I have confirmed these lifecycle rule configurations and understand how they may impact my costs."
- Click OK to complete the lifecycle rule configuration.
Related Operations
OBS allows you to manage tasks. If a multipart upload fails or is interrupted, you can resume it with the following tools. Once the upload is completed, fragments will disappear.
Table 2 Tools for deleting fragments
|
Tool |
Operation Guide |
|
OBS Browser+ |
On OBS Browser+, run the upload task that generates the fragments. Once it completes, fragments are cleared.
For details, see Managing Failed Tasks and Managing Suspended Tasks. |
|
obsutil |
With obsutil, you can resume a failed upload based on its task ID recorded in the result list. After the upload is completed, the fragments will disappear.
For details, see Resuming a Failed Upload. |
|
OBS SDKs |
OBS SDKs provide resumable upload by recording the upload progress. You can read the recorded progress and resume an interrupted or failed multipart upload.
For details, see the section about resumable upload in the SDK Reference. |