FR: Emit warnings when a user attempts to use DirectPath but environment or client is incorrectly configured #2164
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
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()
andattemptDirectPathXds()
(env var equivalents exist as well). During development of gRPC API support in java-storage; the implementation only usedattemptDirectPath()
but failed to notify us that the flagattemptDirectPathXds()
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:attemptDirectPath
is NOT set, CloudPath will be used;attemptDirectPath
is set ANDattemptDirectPathXds
option/env is NOT set, DirectPath gRPCLB is used; (for GCS it will use Cloud Path)attemptDirectPath
is set ANDattemptDirectPathXds
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 keepattemptDirectPathXds
option/env.Describe the solution you'd like
When a user attempts DirectPath using
attemptDirectPath()
or/andattemptDirectPathXds()
; 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: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
The text was updated successfully, but these errors were encountered: