xds: use separate LB configs for EDS policy running with different code paths - #6895
Merged
voidzcy merged 8 commits intoApr 15, 2020
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 |
Contributor
There was a problem hiding this comment.
endpointPickingPolicy is not null
| LoadBalancer.Factory fallbackLbFactory) { | ||
| this.helper = helper; | ||
| this.helper = checkNotNull(helper, "helper"); | ||
| authority = checkNotNull(helper.getAuthority(), "authority"); |
Contributor
There was a problem hiding this comment.
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.
dapengzhang0
approved these changes
Apr 15, 2020
dfawley
pushed a commit
to dfawley/grpc-java
that referenced
this pull request
Jan 15, 2021
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 convertsXdsConfigtoEdsConfigby settingclusterNamefield 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 creatingXdsClientobject intoXdsLoadBalancer) but failed to do so without rewriting the whole set of tests.