Skip to content

fix(storage): use storage-direct.googleapis.com authority for DirectPath over Interconnect - #16584

Merged
kalragauri merged 4 commits into
googleapis:mainfrom
kalragauri:fix/dp-gci-authority
Oct 27, 2026
Merged

kalragauri merged 4 commits into
googleapis:mainfrom
kalragauri:fix/dp-gci-authority

Conversation

@kalragauri

@kalragauri kalragauri commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

When DirectPathXdsOverInterconnectOption (or GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS_OVER_INTERCONNECT=true) is enabled with gRPC 1.85 or later, DefaultOptionsGrpc() sets EndpointOption to google-c2p:///storage-direct.googleapis.com?force-xds, but since #16408 it has defaulted AuthorityOption to storage.googleapis.com. An application that supplies that endpoint through EndpointOption directly gets the same authority from the MergeOptions() fallback. Cloud Storage identifies DirectPath over Interconnect traffic by the :authority of each RPC; when it is storage.googleapis.com, requests are routed as regular DirectPath. RPCs still succeed through the standard route, so the feature is silently inactive.

The storage.googleapis.com default was chosen for TLS hostname verification, and the TLS target name is now the Interconnect hostname, so no override is needed.

This PR changes DefaultOptionsGrpc() to default AuthorityOption to storage-direct.googleapis.com whenever the effective endpoint is a force-xds target for that host and gRPC supports force-xds, covering both the option and an application-supplied endpoint. The default is deliberately restricted to the storage-direct.googleapis.com host: the service recognizes the Interconnect authority only for that host, and gRPC also uses the authority as the TLS target name and the xDS virtual-host key, so a force-xds target for any other host keeps the standard default. An application-supplied AuthorityOption still takes precedence, and non-Interconnect defaults (including gRPC < 1.85) are unchanged.

The option and the environment variable continue to govern only the endpoint the library selects; neither has ever overridden an application-supplied EndpointOption. An application that targets the Interconnect endpoint itself therefore keeps the Interconnect authority even when the variable is false. The DirectPathXdsOverInterconnectOption documentation now states the default :authority, notes that overriding AuthorityOption with a different value disables the feature, and records that neither the option nor the variable changes an application-supplied endpoint. Warning about an AuthorityOption override in LogChannelConfiguration() is left to a follow-up PR.

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Oct 22, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

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 updates the default gRPC options for DirectPath over Interconnect. Specifically, it changes the default AuthorityOption from storage.googleapis.com to storage-direct.googleapis.com when DirectPath over Interconnect is enabled, as the service uses this authority to identify Interconnect traffic. The PR also updates the corresponding documentation and unit tests to reflect this change. I have no feedback to provide as the changes are correct and well-documented.

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.90110% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.36%. Comparing base (513468f) to head (ab7d581).

Files with missing lines Patch % Lines
...gle/cloud/storage/internal/grpc/default_options.cc 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16584      +/-   ##
==========================================
- Coverage   92.39%   92.36%   -0.04%     
==========================================
  Files        2266     2266              
  Lines      220060   220143      +83     
==========================================
+ Hits       203317   203327      +10     
- Misses      16743    16816      +73     

☔ 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.

@kalragauri
kalragauri force-pushed the fix/dp-gci-authority branch from 03a3686 to b11e2e1 Compare October 23, 2026 05:18
@kalragauri kalragauri changed the title fix(storage): set default authority to storage-direct.googleapis.com for DirectPath over Interconnect fix(storage): use storage-direct.googleapis.com authority for DirectPath over Interconnect Oct 23, 2026
@kalragauri

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

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 updates the Google Cloud Storage gRPC plugin to set the default ":authority" header to "storage-direct.googleapis.com" when DirectPath over Interconnect is enabled, ensuring correct routing of Interconnect traffic. The changes include helper functions to detect Interconnect endpoints, updated default options logic, and comprehensive unit tests. Feedback on the changes suggests making the host extraction logic more robust by handling endpoints that explicitly specify a port.

@kalragauri
kalragauri marked this pull request as ready for review October 23, 2026 07:26
@kalragauri
kalragauri requested review from a team as code owners October 23, 2026 07:26
@kalragauri
kalragauri requested a review from v-pratap October 23, 2026 07:26

@v-pratap v-pratap 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.

Looks good overall. The fix keys on the effective endpoint and the main paths are well tested. Main ask: please add edge-case tests for the host parser (port, /, look-alike host). The rest are nits and one question.

std::string_view const host_and_query = endpoint.substr(prefix.size());
std::string_view const host =
host_and_query.substr(0, host_and_query.find_first_of("/?#:"));
return host == kDirectPathInterconnectHost;

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.

nit: host names are case-insensitive, so google-c2p:///Storage-Direct.googleapis.com?force-xds still targets Interconnect but gets the storage.googleapis.com authority. absl::EqualsIgnoreCase(host, kDirectPathInterconnectHost) would close that gap. It's an edge case, so up to you.

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.

The host in a google-c2p:/// target is passed through verbatim by gRPC's C2P resolver as the xDS Listener resource name it requests from Traffic Director, and that lookup is case-sensitive, so Storage-Direct.googleapis.com?force-xds would not resolve to the Interconnect listener anyway. Matching it case-insensitively here would set the Interconnect authority on a target that does not actually reach Interconnect.

Happy to revisit this suggestion.

@kalragauri
kalragauri enabled auto-merge (squash) October 27, 2026 04:45
@kalragauri
kalragauri merged commit e2ca123 into googleapis:main Oct 27, 2026
71 checks passed
@kalragauri
kalragauri deleted the fix/dp-gci-authority branch October 27, 2026 05:12

This branch was previously deployed

1 inactive deployment
false — ab7d581c Deployed Oct 26, 2026 by kalragauri via Save PR ref #12615
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

⌂ 换网址