Skip to content

Commit

Permalink
[ring_hash] allow use without xDS, and allow setting endpoint hash ke…
Browse files Browse the repository at this point in the history
…y in EDS (grpc#38312)

As per gRFC A76 (grpc/proposal#412).

Closes grpc#38312

COPYBARA_INTEGRATE_REVIEW=grpc#38312 from markdroth:ring_hash_changes ae691bb
PiperOrigin-RevId: 708054036
  • Loading branch information
markdroth authored and copybara-github committed Dec 19, 2024
1 parent 01673b0 commit 6fa8043
Show file tree
Hide file tree
Showing 21 changed files with 564 additions and 138 deletions.
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,6 @@ GRPC_XDS_TARGETS = [
"//src/core:grpc_lb_policy_xds_cluster_manager",
"//src/core:grpc_lb_policy_xds_override_host",
"//src/core:grpc_lb_policy_xds_wrr_locality",
"//src/core:grpc_lb_policy_ring_hash",
"//src/core:grpc_resolver_xds",
"//src/core:grpc_resolver_c2p",
"//src/core:grpc_xds_server_config_fetcher",
Expand Down Expand Up @@ -838,6 +837,7 @@ grpc_cc_library(
"//src/core:grpc_lb_policy_outlier_detection",
"//src/core:grpc_lb_policy_pick_first",
"//src/core:grpc_lb_policy_priority",
"//src/core:grpc_lb_policy_ring_hash",
"//src/core:grpc_lb_policy_round_robin",
"//src/core:grpc_lb_policy_weighted_round_robin",
"//src/core:grpc_lb_policy_weighted_target",
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions build_autogenerated.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6011,6 +6011,7 @@ grpc_cc_library(
"grpc_fake_credentials",
"grpc_fault_injection_filter",
"grpc_lb_policy_pick_first",
"grpc_lb_policy_ring_hash",
"grpc_lb_xds_channel_args",
"grpc_matchers",
"grpc_outlier_detection_header",
Expand Down Expand Up @@ -6667,6 +6668,7 @@ grpc_cc_library(
"absl/container:inlined_vector",
"absl/log:check",
"absl/log:log",
"absl/random",
"absl/status",
"absl/status:statusor",
"absl/strings",
Expand All @@ -6679,6 +6681,7 @@ grpc_cc_library(
"closure",
"connectivity_state",
"delegating_helper",
"env",
"error",
"grpc_lb_policy_pick_first",
"grpc_service_config",
Expand All @@ -6690,6 +6693,7 @@ grpc_cc_library(
"lb_policy_registry",
"pollset_set",
"ref_counted",
"ref_counted_string",
"resolved_address",
"unique_type_name",
"validation_errors",
Expand Down
8 changes: 0 additions & 8 deletions src/core/load_balancing/lb_policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,6 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// The LB policy may use the existing metadata to influence its routing
/// decision, and it may add new metadata elements to be sent with the
/// call to the chosen backend.
// TODO(roth): Before making the LB policy API public, consider
// whether this is the right way to expose metadata to the picker.
// This approach means that if a pick modifies metadata but then we
// discard the pick because the subchannel is not connected, the
// metadata change will still have been made. Maybe we actually
// want to somehow provide metadata changes in PickResult::Complete
// instead? Or maybe we use a CallTracer that can add metadata when
// the call actually starts on the subchannel?
MetadataInterface* initial_metadata;
/// An interface for accessing call state. Can be used to allocate
/// memory associated with the call in an efficient way.
Expand Down
Loading

0 comments on commit 6fa8043

Please sign in to comment.