Skip to content

Fill gaps between GcsUtilV2 and GcsUtilV1 - #40244

Merged
shunping merged 9 commits into
apache:masterfrom
shunping:gcs-migration-4
Sep 25, 2026
Merged

shunping merged 9 commits into
apache:masterfrom
shunping:gcs-migration-4

Conversation

@shunping

@shunping shunping commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

This is one of the steps in the final stage of the GCS client library migration.

GcsUtilV2 is the java-storage backed replacement for the gcsio based GcsUtilV1, which can be activated with the --use_gcsutil_v2 experiment. There were some behavior gaps between the two. This PR closes some of the gaps.

Parity gaps closed:

Gap Before Now
Client configuration Application default credentials; --gcsEndpoint ignored Pipeline credentials are passed through (null → NoCredentials), --gcsEndpoint applied as the client host
Metrics Not reported Channels wrapped in Counting{Seekable,Writable}ByteChannel, plus a ServiceCallMetric for GcsGet / GcsInsert
HTTP transport counters Not reported Request count, request shape and status classes, gated on --gcsPerformanceMetrics
Leaked channel create() opened a V2 channel, discarded it, then opened a second on V1 Returns the V2 channel

GcsUtilV2 left credentials to the application default chain, silently
ignoring --gcpCredentialFactoryClass, impersonation and explicit service
account keys that GcsUtilV1 honors. A custom --gcsEndpoint was ignored
outright.

Pass the pipeline's credentials through, mapping a null credential (an
explicit opt-out) to NoCredentials, and apply gcsEndpoint as the client
host.
GcsUtilV2 returned raw channels, so enabling use_gcsutil_v2 silently
dropped every GCS metric that GcsUtilV1 reports: the per-bucket byte
counters from GcsCountersOptions, the gcs_http_*_wire_bytes counters
gated on gcsPerformanceMetrics, and the api_request_count
ServiceCallMetric.

Wrap the channels returned by open() and create() in the existing
Counting{Seekable,Writable}ByteChannel helpers and report a
ServiceCallMetric for GcsGet and GcsInsert, matching V1's labels.
@github-actions github-actions Bot added the build label Sep 23, 2026
@shunping
shunping marked this pull request as ready for review September 23, 2026 19:50
@shunping

Copy link
Copy Markdown
Collaborator Author

r: @derrickaw

@github-actions

Copy link
Copy Markdown
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 assign set of reviewers

@shunping shunping changed the title Fill the final gaps between GcsUtilV2 and GcsUtilV1 Fill gaps between GcsUtilV2 and GcsUtilV1 Sep 23, 2026
@shunping
shunping requested a review from derrickaw September 24, 2026 13:47

@derrickaw derrickaw 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.

Should we have more tests to cover client configuration, metrics, and leaked channel?

@shunping

Copy link
Copy Markdown
Collaborator Author

Should we have more tests to cover client configuration, metrics, and leaked channel?

Added tests for client configuration and metrics. The leaked channel one is a bug and it is trivial to test.

@shunping
shunping requested a review from derrickaw September 24, 2026 19:24
@shunping
shunping merged commit 7203268 into apache:master Sep 25, 2026
26 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants