Skip to content

Conversation

rakshil14-2
Copy link

@rakshil14-2 rakshil14-2 commented Jul 22, 2025

Issue : Github Issue #2874

Description of changes:

Customers requested to prevent overwriting of objects. This is done by providing no-overwrite header. This PR contains implementation of --no-overwrite flag for 2 operations i.e download and sync operations.

  • Download operation
    To prevent overwriting of the file, before initiating the download, file is begin checked at the local system and if the file is absent downloading is allowed else, operation is terminated.
  • Sync operation
    To implement --no-overwrite a new sync strategy has been introduced named to allow transfer of only those files that are not present at the destination. Since files have already been separated before initiating the operation, so again checking for its existence would be redundant and causes extra api calls hence the argument is removed before the transfer begins. This strategy is independent of size and timestamps. Since No-overwrite arg is common for all the operation so now it has been moved to Transfer Args which is used by cp, mv and sync commands

Testing:
Functional testing is performed to validate the object transfer processes. This included both scenarios transferring an object when object with same key is already present in the destination as well as those when the object with same key is not present on destination. These tests were conducted for both object having size less than multipart threshold and one with greater than multipart threshold.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@rakshil14-2 rakshil14-2 marked this pull request as ready for review July 22, 2025 22:53
@rakshil14-2 rakshil14-2 force-pushed the no_overwrite_for_sync_operation branch 2 times, most recently from 2b8e96b to 8f26bf8 Compare July 25, 2025 22:30
@rakshil14-2 rakshil14-2 reopened this Jul 25, 2025
@rakshil14-2 rakshil14-2 reopened this Jul 28, 2025
@rakshil14-2 rakshil14-2 marked this pull request as draft July 28, 2025 16:35
@rakshil14-2 rakshil14-2 force-pushed the no_overwrite_for_sync_operation branch from cf15105 to 8f26bf8 Compare July 28, 2025 16:36
@rakshil14-2 rakshil14-2 marked this pull request as ready for review July 28, 2025 16:42
Rakshil Modi added 2 commits July 28, 2025 10:18
Adding Warning handler for no_overwrite
handled error during download streaming streaming
@rakshil14-2 rakshil14-2 force-pushed the no_overwrite_for_sync_operation branch from ede77f2 to db0a335 Compare July 28, 2025 17:20
Copy link
Contributor

@hssyoo hssyoo left a comment

Choose a reason for hiding this comment

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

Looking good, just had some minor feedback.

Rakshil Modi added 2 commits August 5, 2025 01:58
Updated test case

Updated doc comment

Added test cases

Updating Sync Strategy

Updated comments

Updated comments

Override sync strategy

Overridding sync strategy
Added no overwrite for download operation

handled error during download streaming streaming

Improved upload test cases

Updated test cases

Added test cases

Resolved requested changes

NIT change
@rakshil14-2 rakshil14-2 force-pushed the no_overwrite_for_sync_operation branch from cb64e3a to eb56a58 Compare August 5, 2025 06:00
@kdaily kdaily merged commit ab29b24 into aws:s3-no-overwrite Aug 11, 2025
104 of 105 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants