Skip to content
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: Add support for multiple addresses per endpoint #7858

Merged
merged 8 commits into from
Dec 16, 2024

Conversation

arjan-bal
Copy link
Contributor

@arjan-bal arjan-bal commented Nov 20, 2024

This change adds support for endpoint resources with multiple addresses as part of implementing A61. The change reads the AdditionalAddresses field in the EDS resource. The parsing logic for the AdditionalAddresses is the same as that for the primary address. Validation is added to ensure that primary and additional addresses are unique across all localities. The additional addresses are added ONLY to ResolverState.Endpoints.Addresses when the flag is enabled. LB policies that use the ResolverState.Addresses (e.g. round robin) will not see any change in behaviour. Such LB policies will be updated later to delegate to the new leaf pickfirst LB policy to support endpoints.

A61 mentions that the code to read the new field should be protected by an environment variable flag named GRPC_EXPERIMENTAL_XDS_DUALSTACK_ENDPOINTS which will be removed once the dualstack support is proven stable. This PR adds a hardcoded boolen variable which will be read from the environment all LB policies handle endpoints.

This PR also reactors parts of clusterresolver to pass around a slice of resolver.Endpoints instead of a slice of address strings/addresses. This is required to retain the endpoint grouping. The endpoints list is flattened to an address list to ensure resolver states contain both addresses and endpoints.

RELEASE NOTES: N/A

@arjan-bal arjan-bal added the Area: xDS Includes everything xDS related, including LB policies used with xDS. label Nov 20, 2024
@arjan-bal arjan-bal added this to the 1.69 Release milestone Nov 20, 2024
@arjan-bal arjan-bal requested review from easwars and dfawley November 20, 2024 10:26
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.98%. Comparing base (36d5ca0) to head (64c5642).
Report is 37 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7858      +/-   ##
==========================================
+ Coverage   81.69%   81.98%   +0.28%     
==========================================
  Files         374      379       +5     
  Lines       37978    38261     +283     
==========================================
+ Hits        31028    31367     +339     
+ Misses       5638     5579      -59     
- Partials     1312     1315       +3     
Files with missing lines Coverage Δ
balancer/weightedroundrobin/weightedroundrobin.go 100.00% <100.00%> (ø)
internal/testutils/xds/e2e/clientresources.go 98.18% <100.00%> (+0.04%) ⬆️
...ternal/balancer/clusterresolver/clusterresolver.go 68.08% <100.00%> (+1.12%) ⬆️
...internal/balancer/clusterresolver/configbuilder.go 90.90% <100.00%> (+0.16%) ⬆️
...rnal/balancer/clusterresolver/resource_resolver.go 94.44% <100.00%> (ø)
.../balancer/clusterresolver/resource_resolver_dns.go 72.09% <100.00%> (+6.50%) ⬆️
xds/internal/balancer/wrrlocality/balancer.go 65.26% <100.00%> (+1.13%) ⬆️
xds/internal/internal.go 68.96% <100.00%> (+3.58%) ⬆️
...ds/internal/xdsclient/xdsresource/unmarshal_eds.go 94.57% <100.00%> (+0.21%) ⬆️

... and 48 files with indirect coverage changes

@arjan-bal arjan-bal force-pushed the grpc-go-additional-endpoints branch from e9a9a01 to b196b5f Compare November 20, 2024 10:33
@arjan-bal arjan-bal added the Type: Feature New features or improvements in behavior label Nov 20, 2024
@arjan-bal arjan-bal force-pushed the grpc-go-additional-endpoints branch from b196b5f to 50ba981 Compare November 20, 2024 10:46
Copy link
Contributor

@easwars easwars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't looked at the clusterresolver changes yet.

internal/envconfig/xds.go Outdated Show resolved Hide resolved
xds/internal/balancer/wrrlocality/balancer.go Show resolved Hide resolved
xds/internal/internal.go Show resolved Hide resolved
xds/internal/xdsclient/xdsresource/type_eds.go Outdated Show resolved Hide resolved
@purnesh42H purnesh42H modified the milestones: 1.69 Release, 1.70 Release Dec 5, 2024
Copy link
Contributor

@easwars easwars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay in getting back to this PR.

@easwars easwars assigned arjan-bal and unassigned easwars and dfawley Dec 9, 2024
@arjan-bal arjan-bal assigned easwars and unassigned arjan-bal Dec 11, 2024
@easwars easwars assigned arjan-bal and unassigned easwars Dec 12, 2024
@arjan-bal arjan-bal assigned dfawley and unassigned arjan-bal Dec 13, 2024
@arjan-bal arjan-bal assigned arjan-bal and unassigned dfawley Dec 16, 2024
@arjan-bal arjan-bal merged commit cc161de into grpc:master Dec 16, 2024
15 checks passed
@arjan-bal arjan-bal deleted the grpc-go-additional-endpoints branch December 16, 2024 04:48
purnesh42H pushed a commit to purnesh42H/grpc-go that referenced this pull request Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: xDS Includes everything xDS related, including LB policies used with xDS. Type: Feature New features or improvements in behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants