Skip to content

HDDS-13474. Support abort incomplete multipart upload action#10052

Open
YutaLin wants to merge 4 commits intoapache:HDDS-8342from
YutaLin:HDDS-13474_Support_AbortIncompleteMultipartUpload_Action
Open

HDDS-13474. Support abort incomplete multipart upload action#10052
YutaLin wants to merge 4 commits intoapache:HDDS-8342from
YutaLin:HDDS-13474_Support_AbortIncompleteMultipartUpload_Action

Conversation

@YutaLin
Copy link
Copy Markdown
Contributor

@YutaLin YutaLin commented Apr 6, 2026

What changes were proposed in this pull request?

Support AbortIncompleteMultipartUpload action

Please describe your PR in detail:
configure a lifecycle rule by using the AbortIncompleteMultipartUpload action to minimize storage costs.

What is the link to the Apache JIRA

https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpu-abort-incomplete-mpu-lifecycle-config.html

How was this patch tested?

Add unit tests and xml tests
CI Action (https://github.com/YutaLin/ozone/actions/runs/24017470716)

@spacemonkd spacemonkd changed the title Hdds 13474 support abort incomplete multipart upload action HDDS-13474. Support abort incomplete multipart upload action Apr 6, 2026
@spacemonkd spacemonkd added the s3 S3 Gateway label Apr 6, 2026
@spacemonkd spacemonkd requested a review from ivandika3 April 6, 2026 16:09
Copy link
Copy Markdown
Contributor

@ivandika3 ivandika3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YutaLin Thanks for the new feature. Left some comments.

Comment on lines +781 to +782
while (mpuIterator.hasNext()) {
if (!shouldRun()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add some similar metrics like numKeyIterated for abort incomplete multipart upload case.

OmMultipartKeyInfo mpuKeyInfo = entry.getValue();

// Extract multipart upload information from the key
OmMultipartUpload upload = OmMultipartUpload.from(entry.getKey());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catch the IllegalArgumentException and skip the MPU.

// Check each rule to see if this upload should be aborted
for (OmLCRule rule : mpuRules) {
if (shouldAbortUpload(upload, keyName, rule)) {
expiredUploads.add(upload);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try to break down the delete into multiple batch, see ozone.lifecycle.service.delete.batch-size and its usage in the normal key expiry flow (e.g. LimitedExpiredObjectList)

return false;
}

// TODO: Add tag filtering support when multipart uploads support tags
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multipart uploads should already support tagging so we can support tag based filtering support.

}

@Test
public void testGetLifecycleWithAbortIncompleteMultipartUpload() throws Exception {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add or modify the test in AbstractS3SDKV1Tests and AbstractS3SDKV2Tests to test the E2E flow.

* @param bucketInfo the bucket information
* @param ruleList list of lifecycle rules to evaluate
*/
private void processMultipartUploads(OmBucketInfo bucketInfo, List<OmLCRule> ruleList) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test in TestKeyLifecycleService to test this behavior.

@ivandika3 ivandika3 added the s3-lifecycle HDDS-8342 label Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

s3-lifecycle HDDS-8342 s3 S3 Gateway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants