Skip to content

Commit

Permalink
[pick_first] de-experiment pick first
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanli-ml committed Aug 16, 2023
1 parent 9574b2a commit 2a88a7e
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ class PickFirstConfig : public LoadBalancingPolicy::Config {
return kJsonLoader;
}

void JsonPostLoad(const Json& /* json */, const JsonArgs& /* args */,
ValidationErrors* /* errors */) {}

private:
bool shuffle_addresses_ = false;
};
Expand Down
8 changes: 1 addition & 7 deletions src/core/lib/json/json_object_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -537,13 +537,7 @@ class FinishedJsonObjectLoader<T, kElemCount,
: elements_(elements) {}

void LoadInto(const Json& json, const JsonArgs& args, void* dst,
ValidationErrors* errors) const override {
// Call JsonPostLoad() only if json is a JSON object.
if (LoadObject(json, args, elements_.data(), elements_.size(), dst,
errors)) {
static_cast<T*>(dst)->JsonPostLoad(json, args, errors);
}
}
ValidationErrors* errors) const override {}

private:
GPR_NO_UNIQUE_ADDRESS Vec<Element, kElemCount> elements_;
Expand Down
4 changes: 0 additions & 4 deletions test/core/client_channel/lb_policy/pick_first_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,6 @@ TEST_F(PickFirstTest, GoesIdleWhenConnectionFailsThenCanReconnect) {
}

TEST_F(PickFirstTest, WithShuffle) {
testing::ScopedExperimentalEnvVar env_var(
"GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG");
constexpr std::array<absl::string_view, 6> kAddresses = {
"ipv4:127.0.0.1:443", "ipv4:127.0.0.1:444", "ipv4:127.0.0.1:445",
"ipv4:127.0.0.1:446", "ipv4:127.0.0.1:447", "ipv4:127.0.0.1:448"};
Expand Down Expand Up @@ -516,8 +514,6 @@ TEST_F(PickFirstTest, WithShuffle) {
}

TEST_F(PickFirstTest, ShufflingDisabled) {
testing::ScopedExperimentalEnvVar env_var(
"GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG");
constexpr std::array<absl::string_view, 6> kAddresses = {
"ipv4:127.0.0.1:443", "ipv4:127.0.0.1:444", "ipv4:127.0.0.1:445",
"ipv4:127.0.0.1:446", "ipv4:127.0.0.1:447", "ipv4:127.0.0.1:448"};
Expand Down
3 changes: 0 additions & 3 deletions test/core/xds/xds_lb_policy_registry_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,6 @@ TEST(WrrLocality, UnsupportedChildPolicyTypeSkipped) {
//

TEST(PickFirst, NoShuffle) {
ScopedExperimentalEnvVar env_var("GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG");
LoadBalancingPolicyProto policy;
auto* lb_policy = policy.add_policies();
PickFirst pick_first;
Expand All @@ -463,7 +462,6 @@ TEST(PickFirst, NoShuffle) {
}

TEST(PickFirst, Shuffle) {
ScopedExperimentalEnvVar env_var("GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG");
LoadBalancingPolicyProto policy;
auto* lb_policy = policy.add_policies();
PickFirst pick_first;
Expand All @@ -476,7 +474,6 @@ TEST(PickFirst, Shuffle) {
}

TEST(PickFirst, ShuffleOmitted) {
ScopedExperimentalEnvVar env_var("GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG");
LoadBalancingPolicyProto policy;
auto* lb_policy = policy.add_policies();
lb_policy->mutable_typed_extension_config()->mutable_typed_config()->PackFrom(
Expand Down
2 changes: 0 additions & 2 deletions test/cpp/end2end/xds/xds_pick_first_end2end_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ INSTANTIATE_TEST_SUITE_P(XdsTest, PickFirstTest,
::testing::Values(XdsTestType()), &XdsTestType::Name);

TEST_P(PickFirstTest, PickFirstConfigurationIsPropagated) {
grpc_core::testing::ScopedExperimentalEnvVar env_var(
"GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG");
CreateAndStartBackends(6);
// Change cluster to use pick_first with shuffle option.
auto cluster = default_cluster_;
Expand Down

0 comments on commit 2a88a7e

Please sign in to comment.