From b8ac621d8a6288e86b07dd129c057baa03140586 Mon Sep 17 00:00:00 2001 From: Zach Reyes Date: Tue, 15 Aug 2023 13:21:07 -0400 Subject: [PATCH] Bring in Mohan's change --- internal/envconfig/envconfig.go | 5 ++--- xds/internal/xdsclient/xdslbregistry/xdslbregistry_test.go | 7 +++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/internal/envconfig/envconfig.go b/internal/envconfig/envconfig.go index 27aaf958c5e..3cf10ddfbd4 100644 --- a/internal/envconfig/envconfig.go +++ b/internal/envconfig/envconfig.go @@ -37,9 +37,8 @@ var ( // checking which NACKs configs specifying ring sizes > 8*1024*1024 (~8M). RingHashCap = uint64FromEnv("GRPC_RING_HASH_CAP", 4096, 1, 8*1024*1024) // PickFirstLBConfig is set if we should support configuration of the - // pick_first LB policy, which can be enabled by setting the environment - // variable "GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG" to "true". - PickFirstLBConfig = boolFromEnv("GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG", false) + // pick_first LB policy. + PickFirstLBConfig = boolFromEnv("GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG", true) // LeastRequestLB is set if we should support the least_request_experimental // LB policy, which can be enabled by setting the environment variable // "GRPC_EXPERIMENTAL_ENABLE_LEAST_REQUEST" to "true". diff --git a/xds/internal/xdsclient/xdslbregistry/xdslbregistry_test.go b/xds/internal/xdsclient/xdslbregistry/xdslbregistry_test.go index 58d9b0c86e5..10158889f29 100644 --- a/xds/internal/xdsclient/xdslbregistry/xdslbregistry_test.go +++ b/xds/internal/xdsclient/xdslbregistry/xdslbregistry_test.go @@ -202,7 +202,7 @@ func (s) TestConvertToServiceConfigSuccess(t *testing.T) { rhDisabled: true, }, { - name: "pick_first_disabled_pf_rr_use_first_supported", + name: "pick_first_enabled_pf_rr_use_pick_first", policy: &v3clusterpb.LoadBalancingPolicy{ Policies: []*v3clusterpb.LoadBalancingPolicy_Policy{ { @@ -219,8 +219,7 @@ func (s) TestConvertToServiceConfigSuccess(t *testing.T) { }, }, }, - wantConfig: `[{"round_robin": {}}]`, - pfDisabled: true, + wantConfig: `[{"pick_first": { "shuffleAddressList": true }}]`, }, { name: "least_request_disabled_pf_rr_use_first_supported", @@ -341,7 +340,7 @@ func (s) TestConvertToServiceConfigSuccess(t *testing.T) { defer func(old bool) { envconfig.LeastRequestLB = old }(envconfig.LeastRequestLB) envconfig.LeastRequestLB = false } - if !test.pfDisabled { + if test.pfDisabled { defer func(old bool) { envconfig.PickFirstLBConfig = old }(envconfig.PickFirstLBConfig) envconfig.PickFirstLBConfig = false }