-
Notifications
You must be signed in to change notification settings - Fork 69
Description
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
attemptDirectPathis NOT set, CloudPath will be used; - If
attemptDirectPathis set ANDattemptDirectPathXdsoption/env is NOT set, DirectPath gRPCLB is used; (for GCS it will use Cloud Path) - If
attemptDirectPathis set ANDattemptDirectPathXdsoption/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
- Relying on GCS support to help unblock customers is an alternative through internal dashboards but does not scale.
- Doing nothing is also not acceptable from a usability perspective because there is no signal for a customer to debug the issue.