Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xds: enable ringhash and retry by default #4776

Merged
merged 4 commits into from Sep 16, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 5 additions & 17 deletions internal/xds/env/env.go
Expand Up @@ -62,16 +62,16 @@ var (
// When both bootstrap FileName and FileContent are set, FileName is used.
BootstrapFileContent = os.Getenv(BootstrapFileContentEnv)
// RingHashSupport indicates whether ring hash support is enabled, which can
// be enabled by setting the environment variable
// "GRPC_XDS_EXPERIMENTAL_ENABLE_RING_HASH" to "true".
RingHashSupport = strings.EqualFold(os.Getenv(ringHashSupportEnv), "true")
// be disabled by setting the environment variable
// "GRPC_XDS_EXPERIMENTAL_ENABLE_RING_HASH" to "false".
RingHashSupport = !strings.EqualFold(os.Getenv(ringHashSupportEnv), "false")
// ClientSideSecuritySupport is used to control processing of security
// configuration on the client-side.
//
// Note that there is no env var protection for the server-side because we
// have a brand new API on the server-side and users explicitly need to use
// the new API to get security integration on the server.
ClientSideSecuritySupport = strings.EqualFold(os.Getenv(clientSideSecuritySupportEnv), "true")
ClientSideSecuritySupport = !strings.EqualFold(os.Getenv(clientSideSecuritySupportEnv), "false")
// AggregateAndDNSSupportEnv indicates whether processing of aggregated
// cluster and DNS cluster is enabled, which can be enabled by setting the
// environment variable
Expand All @@ -80,7 +80,7 @@ var (
AggregateAndDNSSupportEnv = strings.EqualFold(os.Getenv(aggregateAndDNSSupportEnv), "true")

// RetrySupport indicates whether xDS retry is enabled.
RetrySupport = strings.EqualFold(os.Getenv(retrySupportEnv), "true")
RetrySupport = !strings.EqualFold(os.Getenv(retrySupportEnv), "false")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this intentional? It effectively enables Retry by default (not just with xDS). IE: We no longer need to set GRPC_GO_RETRY=on.

In envconfig.go:

Retry = strings.EqualFold(os.Getenv(retryStr), "on") || xdsenv.RetrySupport

envconfig.Retry will allways be true as long as GRPC_XDS_EXPERIMENTAL_ENABLE_RETRY is undefined.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this was intentional, then GRPC_GO_RETRY should probably be retired, as it does not have the same semantics anymore (and this is confusing).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was intentional, though it wasn't intentional that it overrides GRPC_GO_RETRY=off. Maybe we should fix that before the release (make GRPC_GO_RETRY default to on, and disable retry if either GRPC_GO_RETRY=off or GRPC_XDS_EXPERIMENTAL_ENABLE_RETRY=false).

Also this should be release-noted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4899 fixes GRPC_GO_RETRY=off to disable retry as one would expect.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is good for me that I can rely on retry being enabled by default from v1.41.0 onward.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we will remove this as a configurable setting entirely in the future (hopefully v1.42). It is & will always be controllable per-ClientConn via the WithDisableRetry dial option. Aaand I'll send a PR to fix the docstring on that method next.


// C2PResolverSupport indicates whether support for C2P resolver is enabled.
// This can be enabled by setting the environment variable
Expand All @@ -89,15 +89,3 @@ var (
// C2PResolverTestOnlyTrafficDirectorURI is the TD URI for testing.
C2PResolverTestOnlyTrafficDirectorURI = os.Getenv(c2pResolverTestOnlyTrafficDirectorURIEnv)
)

func init() {
// Set the env var used to control processing of security configuration on
// the client-side to true by default.
// TODO(easwars): Remove this env var completely in 1.42.x release.
//
// If the env var is set explicitly, honor it.
ClientSideSecuritySupport = true
if val, ok := os.LookupEnv(clientSideSecuritySupportEnv); ok {
ClientSideSecuritySupport = strings.EqualFold(val, "true")
}
}