Skip to content

CompleteMultipartUpload is idempotent#2593

Merged
afranken merged 2 commits intomainfrom
2586-mulitpart-upload-fixes
Aug 29, 2025
Merged

CompleteMultipartUpload is idempotent#2593
afranken merged 2 commits intomainfrom
2586-mulitpart-upload-fixes

Conversation

@afranken
Copy link
Member

Description

CompleteMultipartUpload will not delete MultipartUpload data, only the parts.
This is only part of a fix, we really shouldn't delete parts at all and preserve all multipart data, streaming a full binary on getObject requests.

Related Issue

#2586

Tasks

  • I have signed the CLA.
  • I have written tests and verified that they fail without my change.

@afranken afranken self-assigned this Aug 28, 2025
@afranken afranken added the bug label Aug 28, 2025
@afranken afranken force-pushed the 2586-mulitpart-upload-fixes branch from 6c26292 to 6f9634a Compare August 28, 2025 22:25
@afranken afranken requested a review from Copilot August 28, 2025 22:25

This comment was marked as outdated.

CompleteMultipartUpload will not delete MultipartUpload data, only the
parts.
This is only part of a fix, we really shouldn't delete parts at all and
preserve all multipart data, streaming a full binary on getObject
requests.

Fixes #2586
@afranken afranken force-pushed the 2586-mulitpart-upload-fixes branch from 0e6db31 to 2d6aab2 Compare August 29, 2025 13:28
@afranken afranken requested a review from Copilot August 29, 2025 13:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements idempotent behavior for CompleteMultipartUpload operations, allowing the same multipart upload to be completed multiple times without error. The key changes preserve multipart upload metadata after completion and modify the completion logic to handle already-completed uploads.

  • Add a completed boolean field to track multipart upload state
  • Modify completion logic to handle already-completed uploads by returning cached results
  • Update multipart store operations to differentiate between active and completed uploads

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
server/src/main/java/com/adobe/testing/s3mock/store/MultipartUploadInfo.java Add completed field and helper methods to track multipart upload completion state
server/src/main/java/com/adobe/testing/s3mock/store/MultipartStore.java Update store operations to handle completed uploads and preserve metadata after completion
server/src/main/java/com/adobe/testing/s3mock/service/MultipartService.java Add includeCompleted parameter to verification methods for handling completed uploads
server/src/main/java/com/adobe/testing/s3mock/MultipartController.java Implement idempotent completion logic by checking upload state and returning cached results
integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/MultipartIT.kt Add integration test to verify idempotent behavior of CompleteMultipartUpload
Multiple pom.xml files Update version from 4.7.1-SNAPSHOT to 4.8.0-SNAPSHOT
Multiple test files Update test calls to match new method signatures with includeCompleted parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

ChecksumType.COMPOSITE
);
FileUtils.deleteDirectory(partFolder.toFile());
//delete parts and update MultipartInfo
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

The comment should use proper capitalization: 'Delete parts and update MultipartInfo'.

Suggested change
//delete parts and update MultipartInfo
// Delete parts and update MultipartInfo

Copilot uses AI. Check for mistakes.
@afranken afranken merged commit f26855b into main Aug 29, 2025
6 checks passed
@afranken afranken deleted the 2586-mulitpart-upload-fixes branch August 29, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants