feat(storage): implement atomic compose via DeleteSourceObjects#4804
Draft
PranjalC100 wants to merge 4 commits into
Draft
feat(storage): implement atomic compose via DeleteSourceObjects#4804PranjalC100 wants to merge 4 commits into
PranjalC100 wants to merge 4 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4804 +/- ##
===========================================
+ Coverage 0 83.68% +83.68%
===========================================
Files 0 168 +168
Lines 0 20897 +20897
===========================================
+ Hits 0 17487 +17487
- Misses 0 2758 +2758
- Partials 0 652 +652
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request implements an atomic compose operation by introducing a
DeleteSourceObjectsboolean inside theComposeObjectsRequest. It leverages the new GCS Compose API functionality that allows atomically deleting source objects on the server-side the exact millisecond a compose operation completes.This change fundamentally resolves race conditions, early deletion billing spikes, and "soft delete" charges commonly encountered during append-heavy AI/ML workloads.
Key Changes:
cloud.google.com/go/storagetov1.63.0to gain access to theDeleteSourceObjectsattribute on the Compose request.DeleteSourceObjects: trueflag during GCS object composition viaComposeObjectCreatorand removed the manualDeleteObjectdeferred calls.ComposeObjectsAPI call fails mid-flight, the server-side deletion never triggers. The unmodified garbage collector acts as an excellent, zero-overhead resilient fallback to find and delete these rare orphaned chunks.ComposeObjectssignature infake/bucket.goto explicitly simulate atomic slice deletion of source objects inside integration test mocks.Link to the issue in case of a bug fix:
b/430606937
Testing details
make build.compose_object_creator_test.goproperly asserts forreq.DeleteSourceObjectsand that legacyDeleteObjectexpectations were removed. Added a new explicitDeleteSourceObjectsunit test suite tointernal/storage/fake/testing/bucket_tests.go. All tests passed successfully.Any backward incompatible change? If so, please explain.
N/A