-
Notifications
You must be signed in to change notification settings - Fork 3.9k
xds: use separate LB configs for EDS policy running with different code paths #6895
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: use separate LB configs for EDS policy running with different code paths #6895
Conversation
…ion. Changed its usage in XdsLoadBalancer.
…separate_lb_config_for_full_flow_and_eds_only
"Received EDS lb config: cluster={0}, child_policy={1}, " | ||
+ "eds_service_name={2}, report_load={3}", | ||
newEdsConfig.clusterName, | ||
newEdsConfig.endpointPickingPolicy != null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
endpointPickingPolicy
is not null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -91,7 +96,8 @@ public void onAllDrop() { | |||
Helper helper, | |||
PrimaryLbFactory primaryLbFactory, | |||
LoadBalancer.Factory fallbackLbFactory) { | |||
this.helper = helper; | |||
this.helper = checkNotNull(helper, "helper"); | |||
authority = checkNotNull(helper.getAuthority(), "authority"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This field is only used in one place, and can be inlined with helper.getAuthority()
there. No need to check nullness of helper's authority.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
…de paths (grpc#6895) The LB configs used for EDS policy diverges for the full xDS flow (generated by CDS policy) and EDS-only flow (received in service config). This change creates a separate config (EdsConfig) for the actual EDS LB policy. CDS policy generates EdsConfig directly and the wrapper policy (i.e., XdsLoadBalancer) converts received XdsConfig to EdsConfig for EDS-only flow.
In the latest design, the LB config for EDS policy started to diverge for the full xDS flow and for EDS only flow (internal. legacy?).
This changes separates the usage of LB configs for these two code paths:
For full xDS flow (received from CDS LB policy):
For EDS only flow (received from remote resolver):
Since the EDS only flow (
XdsLoadBalancer
) also delegates load balancing logic toEdsLoadBalancer
, it convertsXdsConfig
toEdsConfig
by settingclusterName
field to target authority.This PR only cleans up LB config(s) (types) for EDS policy, no behavior-wise change.
This PR replaces #6887, which tries to do more cleanup (e.g., refactor
FallbackLb
, move logic of creatingXdsClient
object intoXdsLoadBalancer
) but failed to do so without rewriting the whole set of tests.