Skip to content

fix(storage): preserve requested attributes during compose - #5238

Open
singh4jitendra wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
singh4jitendra:fix/compose-destination-attributes
Open

singh4jitendra wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
singh4jitendra:fix/compose-destination-attributes

Conversation

@singh4jitendra

Copy link
Copy Markdown
Contributor

Description

The append path asks Compose to preserve object metadata and content settings, but the storage adapter was not passing those values to the SDK.

This copies the requested destination attributes onto the Composer, including custom metadata and gcsfuse_mtime. The tests check the outgoing request and keep generation checks and atomic source deletion covered.

Link to the issue in case of a bug fix.

Fixes #5235

Testing details

Go 1.27.2, Ubuntu 24.04 under WSL.

  1. Manual -
    • make build - passed, including vet, lint (0 issues), formatting and compilation.
  2. Unit tests -
    • go test -mod=readonly -p 1 -count=1 -timeout=90s -run '^TestComposeObjects(DestinationAttributes|InvalidCustomTime)$' ./internal/storage - failed as expected before the fix.
    • go test -mod=readonly -p 1 -count=1 -race -timeout=90s -run 'TestComposeObjects|TestBucketHandleTestSuite/TestComposeObject|TestSetAttrsInWriter|TestConvertObjectAccessControl|TestComposeObjectCreator' ./internal/storage ./internal/storage/storageutil ./internal/gcsx - passed after formatting.
    • go test -mod=readonly -p 1 -count=1 -race -timeout=5m ./internal/storage - passed on rerun.
    • Full race suites for ./internal/storage/storageutil and ./internal/gcsx also passed. The first combined run hit an unrelated retry test with a 100-microsecond deadline; that failure was reproduced on the untouched baseline. No retry tests were changed.
  3. Integration tests - Not run against GCS. Request tests use a local HTTP server without credentials.

Any backward incompatible change? If so, please explain.

Compose now honors attributes that were already present in its request but were ignored. An invalid non-empty custom-time value returns an error instead of being silently dropped. Empty optional values keep the SDK defaults. Source selection and destination preconditions are unchanged.

Copy destination metadata and content attributes onto the SDK Composer, share ACL conversion with writes, and reject invalid custom times. Verify outgoing attributes, source generations, destination conditions and source deletion with local HTTP tests.

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request updates the object composition logic in ComposeObjects to populate destination object attributes from the request, refactors ACL conversion into a helper function, and adds comprehensive unit tests. However, a critical compilation error was identified in bucket_handle.go where CustomTime is assigned directly to the composer instance instead of composer.ObjectAttrs.CustomTime.

Comment thread internal/storage/bucket_handle.go Resolved
@singh4jitendra
singh4jitendra marked this pull request as ready for review November 12, 2026 08:11
@singh4jitendra
singh4jitendra requested a review from a team as a code owner November 12, 2026 08:11
@singh4jitendra

Copy link
Copy Markdown
Contributor Author

Hi @abhishek10004, could you take a look at this Compose fix when you have some time? Happy to discuss anything that needs adjusting. Thanks!

@singh4jitendra

Copy link
Copy Markdown
Contributor Author

Hi @abhishek10004, could you review this when you have a moment and merge if everything looks good? Thanks!

@singh4jitendra

Copy link
Copy Markdown
Contributor Author

Hi @abhishek10004, a quick follow-up on the Compose attributes fix. Could you take a look when you have a moment? Let me know if anything needs adjusting. Thanks!

@singh4jitendra

Copy link
Copy Markdown
Contributor Author

Hi @abhishek10004, I'd appreciate a review of the Compose attributes fix when you get a chance. Please let me know if you'd like anything changed. Thanks!

@singh4jitendra

Copy link
Copy Markdown
Contributor Author

Hi @abhishek10004, could you take a look at the Compose attributes fix when you have a moment? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant