Skip to content

fix(storage): update PartSize documentation and optimize cleanup - #19930

Merged
cpriti-os merged 10 commits into
googleapis:mainfrom
cpriti-os:pcu-improve
Sep 30, 2026
Merged

cpriti-os merged 10 commits into
googleapis:mainfrom
cpriti-os:pcu-improve

Conversation

@cpriti-os

Copy link
Copy Markdown
Contributor

No description provided.

@cpriti-os
cpriti-os requested review from a team as code owners June 9, 2026 05:42
@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Jun 9, 2026
@cpriti-os
cpriti-os requested a review from krishnamd-jkp June 9, 2026 05:42

@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 renames PartSize to PartSizeHint in ParallelUploadConfig, increases the minimum part size from 5 MiB to 8 MiB, and updates the associated tests. It also optimizes cleanup by enabling automatic deletion of source objects during compose operations (DeleteSourceObjects = true) and updating the local cleanup logic to run only when an upload fails and the final compose does not succeed. Feedback was provided regarding the background cleanup goroutine, which currently uses the potentially canceled parent context. To prevent temporary object leaks when a context is canceled, it is recommended to use context.WithoutCancel for the cleanup operation.

Comment thread storage/pcu.go
Comment thread storage/pcu.go Outdated
Comment thread storage/pcu.go Outdated
@cpriti-os
cpriti-os requested a review from krishnamd-jkp June 10, 2026 08:44
@cpriti-os cpriti-os changed the title chore(storage): support PartSizeHint and optimize cleanup chore(storage): update PartSize documentation and optimize cleanup Sep 24, 2026
Comment thread storage/pcu.go

interHandle := s.w.o.c.Bucket(s.w.o.bucket).Object(compName)
composer := interHandle.ComposerFrom(finalComps[start:end]...)
composer.DeleteSourceObjects = true

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.

Should this be an option exposed to the user?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no, doesn't add much value and we do not want to expose the intricacies of how parallel upload is being done.

@cpriti-os cpriti-os changed the title chore(storage): update PartSize documentation and optimize cleanup fix(storage): update PartSize documentation and optimize cleanup Sep 28, 2026
setError ignores context.Canceled, so gating cleanup on firstErr skipped
cleanup for cancelled uploads and leaked temporary parts. Cleanup now runs
whenever the final compose did not succeed.
With DeleteSourceObjects, a successful intermediate compose removes its
sources server-side. If a later compose fails, cleanup would log a
not-found error for each of those parts. Skip ErrObjectNotExist.
@cpriti-os
cpriti-os merged commit 3d09abf into googleapis:main Sep 30, 2026
17 checks passed
sahusneha2004 pushed a commit that referenced this pull request Oct 1, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.69.0](storage/v1.68.0...storage/v1.69.0)
(2026-10-01)


### Features

* **all:** Update supported go versions
([#20520](#20520))
([90413d3](90413d3))
* **storage:** Add read stall retry for gRPC storage client
([#20525](#20525))
([8bfc486](8bfc486))


### Bug Fixes

* **storage:** Add App Hub storage.googleapis.com prefix to
destination.id
([#20569](#20569))
([2bca92a](2bca92a))
* **storage:** Follow-ups for read stall retry
([#20577](#20577))
([24eacd5](24eacd5))
* **storage:** Update PartSize documentation and optimize cleanup
([#19930](#19930))
([3d09abf](3d09abf))
* **various:** Address format directive issues
([#20547](#20547))
([e2e1047](e2e1047))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants