Repository navigation
Route the remaining GCS calls through GcsUtilV2 when enabled - #40273
Merged
Merged
Conversation
The facade only had V2 branches on its GcsPath-typed methods, but GcsFileSystem and GcpOptions call the String-typed and legacy-model ones, so match, list, copy, rename, delete and bucket creation all stayed on V1 even with use_gcsutil_v2 set. Add V2 branches to those, converting Blob and BucketInfo back to the JSON API model so their callers need no change. Strategies are picked to match V1: copy and rename rewrite without a destination precondition, remove ignores a 404, and buckets are created with projectPrivate ACLs.
The formula is copied rather than read from AsyncWriteChannelOptions because GcsUtilV2 has no other gcsio reference and the migration ends with that dependency deleted. The test keeps the two values in sync.
- Translate StorageException thrown on write channel close. - Record a 404 request metric when open() hits a missing object.
Route all client access through a @VisibleForTesting storage() accessor. In GcsUtilTest, merge the V2 helpers into one, test bucketAccessible through a mocked client, and reset metrics containers in tearDown.
shunping
marked this pull request as ready for review
September 25, 2026 15:13
Collaborator
Author
|
r: @derrickaw |
Contributor
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
derrickaw
reviewed
Sep 25, 2026
derrickaw
approved these changes
Sep 26, 2026
derrickaw
left a comment
Collaborator
There was a problem hiding this comment.
LGTM - just one nit on adding reference/comment.
15 of 35 tasks
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.
Follow-up to #40244. With
use_gcsutil_v2 set, the facade only sent its GcsPath-typed methods to V2. GcsFileSystem and GcpOptions call the String-typed and legacy-model methods, so match, list, copy, rename, delete and bucket creation all stayed on V1.Changes
GcsUtil:when GcsUtilV2 is enabled, every method that predates V2 now goes to V2. That includesgetObject(s),listObjects,getBucket,create(path, type[, bufferSize]),copy,rename,remove, andcreate/removeBucket. Results are converted back to the JSON API model, so callers don't change. V1 behavior is kept:GcsUtilV2:createBuckettakesBucketTargetOption...and an optional project ID.IOException, not an uncheckedStorageException.open()on a missing object now records anot_foundrequest metric.bucketAccessiblereturnsfalseonly for a missing bucket or denied access. Other errors (e.g. 5xx) are thrown, so they no longer show up as an inaccessible bucket.ParquetIOLT:use_gcsutil_v2is now sent to Dataflow jobs. It's joined with the worker experiment, since experiments can only be passed once.