-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Fix least request lb not fair #29873
Merged
wbpcode
merged 14 commits into
envoyproxy:main
from
barroca:ldamata/fix-least-request-LB-not-fair
Oct 26, 2023
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
bf274e2
Add new idea for selecting hosts among those not selected yet.
barroca e5237d5
Change how we choose full table scan
barroca d9f6c1a
Remove cout
barroca 7711181
Fix Tests for load_balancer_impl_test
barroca 032d925
Fix format and make sure full scan happens only when selected or the …
barroca 99863c0
Enable new option on extesions api only
barroca e58b34f
Fix Integration tests.
barroca 92163ec
Merge remote-tracking branch 'origin' into ldamata/fix-least-request-…
barroca f98ac94
Add release notes for full scan in least request LB.
barroca 0aea580
Fix ref for release note.
barroca 3c15f4e
Fix release notes
barroca 1f9b298
Update release note
barroca 35e87e5
Merge branch 'main' into ldamata/fix-least-request-LB-not-fair
barroca 1bf4ac3
Merge branch 'main' into ldamata/fix-least-request-LB-not-fair
barroca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,7 +176,10 @@ class HttpSubsetLbIntegrationTest | |
} | ||
} | ||
|
||
if (is_hash_lb_) { | ||
// The default number of choices for the LEAST_REQUEST policy is 2 hosts, if the number of hosts | ||
// is equal to the number of choices, a full scan happens instead, this means that the same host | ||
// will be chosen. | ||
if (is_hash_lb_ || (GetParam() == envoy::config::cluster::v3::Cluster::LEAST_REQUEST)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there is an way of checking the number of hosts of the cluster so we can make sure the test has the correct behaviour that would be great, for now I added a comment on why we need this check on the test here. |
||
EXPECT_EQ(hosts.size(), 1) << "Expected a single unique host to be selected for " | ||
<< envoy::config::cluster::v3::Cluster::LbPolicy_Name(GetParam()); | ||
} else { | ||
|
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.
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.
This PR change the behavior of the LB. It's necessary to add some more comment to tell that if the
choice_count
is larger than or equal to the hosts size, a full scan will be used.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.
This behavior change should be harmless to end users and maybe make this LB's behavior closer to it's name
least request
.So, I think a change log should enough rather than a runtime guard.
But still need a check from @envoyproxy/runtime-guard-changes