Skip to content

FR: Emit warnings when a user attempts to use DirectPath but environment or client is incorrectly configured #2164

@frankyn

Description

@frankyn

Is your feature request related to a problem? Please describe.
When a user tries to use DirectPath for GCS; there are two "flags" to enable: attemptDirectPath() and attemptDirectPathXds() (env var equivalents exist as well). During development of gRPC API support in java-storage; the implementation only used attemptDirectPath() but failed to notify us that the flag attemptDirectPathXds() was also needed. The result was ~2 weeks of debugging why java-storage was using Cloud Path when attemptDirectPath() was used.

More context is provided by @mohanli-ml from the gRPC team:

attemptDirectPath is originally created for DirectPath gRPCLB (gRPCLB is the name resolver). Then DirectPath xDS was developed (Traffic Director is the name resolver) and we decide to migrate DirectPath gRPCLB to DirectPath xDS. To differentiate the two DirectPath infrastructures, attemptDirectPathXds option/env were created:

  • If attemptDirectPath is NOT set, CloudPath will be used;
  • If attemptDirectPath is set AND attemptDirectPathXds option/env is NOT set, DirectPath gRPCLB is used; (for GCS it will use Cloud Path)
  • If attemptDirectPath is set AND attemptDirectPathXds option/env is set, DirectPath xDS is used.

Currently the migration is still ongoing as CBT still has DirectPath gRPCLB traffic (CBT's timeline is Q4). After that, I will cleanup DirectPath gRPCLB code in the gax library. For example, attemptDirectPath will be removed and we just need to keep attemptDirectPathXds option/env.

Describe the solution you'd like

When a user attempts DirectPath using attemptDirectPath() or/and attemptDirectPathXds(); there should be warnings emitted if the attempt failed to use DirectPath. Otherwise, the attempt behaves like a blackbox unless a user enables verbose logging to inspect the CIDR block being used by remote IP addresses. Additionally, there are other conditions where DirectPath may fail:

  • Directpath attempted without GCE Credentials
  • Directpath attempted outside of GCE

It would be great to extend this methodology to future conditions that could cause CloudPath to be used when attempting DirectPath but it's hard to predict or prepare ahead of time.

Describe alternatives you've considered

  1. Relying on GCS support to help unblock customers is an alternative through internal dashboards but does not scale.
  2. Doing nothing is also not acceptable from a usability perspective because there is no signal for a customer to debug the issue.

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions