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

feat(translator): Set zone for endpoint and arrange endpoints by zone in EDS #3542

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

aoledk
Copy link
Contributor

@aoledk aoledk commented Jun 5, 2024

What this PR does / why we need it:

Set zone for endpoint and arrange endpoints by zone in EDS if zone is available in EndpointSlice. This is required before users can apply priority levels or zone aware routing load balancing strategy.

Which issue(s) this PR fixes:

Fixes #3538

Signed-off-by: Dingkang Li <dingkang1743@gmail.com>
@aoledk aoledk requested a review from a team as a code owner June 5, 2024 08:30
LbEndpoints: endpoints,
Priority: 0,
// If irEp has unset zone, leave it empty.
var zone string
Copy link
Contributor

Choose a reason for hiding this comment

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

this breaks weight based routing, currently a setting has a weight, and there's 1:1 b/w xds locality and IR setting

Copy link
Contributor

Choose a reason for hiding this comment

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

this can be fixed by copying the IR setting weight into lbEndpoint.LoadBalancingWeight (currently set to 1) and removing the locality weight (or setting it to 1)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems like splitting 1 backend with specific weight (as 1 IR setting) to multiple localities with same specific weight doesn't break weighted based routing.

Compared to your suggestion in which we assign the specific weight to individual endpoint, the same endpoint has same chance to be chosen by envoy.

Since EG has enabled locality weighted load balancing, we must set locality weight, or else the locality will not be assigned any load 1.

CommonLbConfig: &clusterv3.Cluster_CommonLbConfig{
LocalityConfigSpecifier: &clusterv3.Cluster_CommonLbConfig_LocalityWeightedLbConfig_{
LocalityWeightedLbConfig: &clusterv3.Cluster_CommonLbConfig_LocalityWeightedLbConfig{},
},
},

Footnotes

  1. https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/endpoint/v3/endpoint_components.proto#config-endpoint-v3-localitylbendpoints

Copy link

codecov bot commented Jun 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.34%. Comparing base (4a74e60) to head (026f29f).

Current head 026f29f differs from pull request most recent head eba8f1c

Please upload reports for the commit eba8f1c to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3542      +/-   ##
==========================================
- Coverage   68.81%   68.34%   -0.47%     
==========================================
  Files         175      170       -5     
  Lines       21525    20770     -755     
==========================================
- Hits        14812    14196     -616     
+ Misses       5636     5556      -80     
+ Partials     1077     1018      -59     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aoledk
Copy link
Contributor Author

aoledk commented Jun 6, 2024

/retest

@aoledk aoledk marked this pull request as draft July 1, 2024 02:21
Copy link

github-actions bot commented Aug 2, 2024

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, when it's ready. Thank you for your contributions!

@github-actions github-actions bot added the stale label Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set zone from EndpointSlice for xDS Endpoint
2 participants