Repository navigation
fix(storage): preserve requested attributes during compose - #5238
singh4jitendra wants to merge 1 commit into
Conversation
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.
There was a problem hiding this comment.
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.
|
Hi @abhishek10004, could you take a look at this Compose fix when you have some time? Happy to discuss anything that needs adjusting. Thanks! |
|
Hi @abhishek10004, could you review this when you have a moment and merge if everything looks good? Thanks! |
|
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! |
|
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! |
|
Hi @abhishek10004, could you take a look at the Compose attributes fix when you have a moment? Thanks! |
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.
make build- passed, including vet, lint (0 issues), formatting and compilation.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../internal/storage/storageutiland./internal/gcsxalso 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.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.