Skip to content

feat(storage): implement atomic compose via DeleteSourceObjects - #4804

Merged
PranjalC100 merged 2 commits into
masterfrom
feature/delete-source-objects-compose
Aug 31, 2026
Merged

PranjalC100 merged 2 commits into
masterfrom
feature/delete-source-objects-compose

Conversation

@PranjalC100

@PranjalC100 PranjalC100 commented Jun 26, 2026 •

Copy link
Copy Markdown
Member

Description

This pull request implements an atomic compose operation by introducing a DeleteSourceObjects boolean inside the ComposeObjectsRequest. 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.

Impact:
This change fundamentally resolves race conditions, early deletion billing spikes, and "soft delete" charges commonly encountered during append-heavy AI/ML workloads.

Key Changes:

  • Core Implementation: Passed the DeleteSourceObjects: true flag during GCS object composition via ComposeObjectCreator and removed the manual DeleteObject deferred calls.
  • Garbage Collector (Fallback): The background garbage collector was intentionally retained as a resilient fallback to clean up orphaned chunks if a process crashes before compose.
  • Mock & Test Updates: Updated fake/bucket.go to simulate source deletion and added unit tests in bucket_tests.go, bucket_handle_test.go, and compose_object_creator_test.go.

Link to the issue in case of a bug fix:

b/430606937

Testing details

  1. Manual: Executed standard test sweeps and compilation checks locally via make build.
  2. Unit tests: Verified go test -race ./internal/storage/... ./internal/gcsx/... passes cleanly.
  3. Integration tests: Triggered via PR labels (execute-integration-tests, execute-integration-tests-on-zb).

Any backward incompatible change? If so, please explain.

N/A

@codecov

codecov Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.97%. Comparing base (7b39292) to head (d6d7939).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4804      +/-   ##
==========================================
+ Coverage   83.93%   83.97%   +0.04%     
==========================================
  Files         176      176              
  Lines       21563    21630      +67     
==========================================
+ Hits        18098    18163      +65     
- Misses       2765     2766       +1     
- Partials      700      701       +1     
Flag Coverage Δ
unittests 83.97% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PranjalC100
PranjalC100 force-pushed the feature/delete-source-objects-compose branch from 482c0ab to 0163678 Compare August 5, 2026 15:12
@PranjalC100 PranjalC100 added execute-integration-tests Run only integration tests execute-integration-tests-on-zb To run E2E tests on zonal bucket. labels Aug 5, 2026
@PranjalC100
PranjalC100 force-pushed the feature/delete-source-objects-compose branch 2 times, most recently from 73be66d to 96d222d Compare August 10, 2026 10:54
@PranjalC100
PranjalC100 marked this pull request as ready for review August 10, 2026 10:59
@PranjalC100
PranjalC100 requested a review from a team as a code owner August 10, 2026 10:59
@PranjalC100
PranjalC100 requested a review from raj-prince August 10, 2026 10:59
@github-actions github-actions Bot added the remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. label Aug 10, 2026
@PranjalC100
PranjalC100 requested review from abhishek10004 and meet2mky and removed request for raj-prince August 10, 2026 10:59
Comment thread internal/gcsx/compose_object_creator.go Resolved
@PranjalC100
PranjalC100 requested a review from meet2mky August 10, 2026 12:10
@github-actions

Copy link
Copy Markdown

Hi @abhishek10004, @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

7 similar comments
@github-actions

Copy link
Copy Markdown

Hi @abhishek10004, @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@github-actions

Copy link
Copy Markdown

Hi @abhishek10004, @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@github-actions

Copy link
Copy Markdown

Hi @abhishek10004, @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@github-actions

Copy link
Copy Markdown

Hi @abhishek10004, @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@github-actions

Copy link
Copy Markdown

Hi @abhishek10004, @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@github-actions

Copy link
Copy Markdown

Hi @abhishek10004, @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@github-actions

Copy link
Copy Markdown

Hi @abhishek10004, @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@PranjalC100
PranjalC100 force-pushed the feature/delete-source-objects-compose branch 2 times, most recently from bcef5d1 to f71af26 Compare August 21, 2026 05:56
@PranjalC100
PranjalC100 force-pushed the feature/delete-source-objects-compose branch from f71af26 to 290be5f Compare August 21, 2026 06:22
@PranjalC100
PranjalC100 requested a review from anushka567 August 21, 2026 07:03
anushka567
anushka567 previously approved these changes Aug 23, 2026

@anushka567 anushka567 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

@PranjalC100
PranjalC100 enabled auto-merge (squash) August 24, 2026 05:34
@github-actions

Copy link
Copy Markdown

Hi @abhishek10004, @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

4 similar comments
@github-actions

Copy link
Copy Markdown

Hi @abhishek10004, @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@github-actions

Copy link
Copy Markdown

Hi @abhishek10004, @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@github-actions

Copy link
Copy Markdown

Hi @abhishek10004, @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@github-actions

Copy link
Copy Markdown

Hi @abhishek10004, @meet2mky, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

Comment thread internal/gcsx/compose_object_creator.go Resolved

@abhishek10004 abhishek10004 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Left one minor comment. Rest looks good. Haven't checked the UTs, will rely on previous reviewer's review for that.

@abhishek10004 abhishek10004 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@PranjalC100
PranjalC100 merged commit 42afe54 into master Aug 31, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

execute-integration-tests Run only integration tests execute-integration-tests-on-zb To run E2E tests on zonal bucket. remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

⌂ 换网址