Skip to content

[v2] Refactor to standalone source HeadObject for copies#10375

Closed
hssyoo wants to merge 1 commit into
s3-mpu-copy-v2from
pr/copy-head-object-refactor
Closed

[v2] Refactor to standalone source HeadObject for copies#10375
hssyoo wants to merge 1 commit into
s3-mpu-copy-v2from
pr/copy-head-object-refactor

Conversation

@hssyoo

@hssyoo hssyoo commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

This PR refactors HeadObject calls during S3 to S3 multipart copies. Currently, the HeadObject request is called in SetMetadataDirectivePropsSubscriber. This isn't ideal since it couples HeadObject invocations to a specific subscriber. We want to open it up so that other subscribers can consume the HeadObject response, even if SetMetadataDirectivePropsSubscriber never fires.

Specifically, this refactor unblocks the following future changes:

  • Update SetTagsSubscriber so it only fires if TagCount in HeadObject response is greater than 0.
  • Hypothetical, but if we wanted to support more options for --copy-props (eg tagging) in the future, then these values can be fetched and copied independently from metadata.

@hssyoo hssyoo requested a review from a team as a code owner June 2, 2026 20:19
@hssyoo hssyoo requested a review from kdaily June 2, 2026 20:28
@hssyoo

hssyoo commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Closing because the tag count optimization turns out to be infeasible.

The issue is that HeadObject will not return tag count at all under either conditions:

  • Identity lacks permissions to get tags/tag count.
  • The object doesn't have any tags.

Currently, S3 commands with --copy-props default will fail loudly if identity lacks tag permissions. With this optimization, it would start to fail silently, ie copy objects without tags since it doesn't see tag count in the HeadObject response. If HeadObject returned tag count = 0 when object doesn't have tags this would be possible but the current API doesn't give clients a way to distinguish between an object having 0 tags versus identity lacking tag permissions.

@hssyoo hssyoo closed this Jun 5, 2026
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.

1 participant