-
Notifications
You must be signed in to change notification settings - Fork 5.5k
upstream: allow excluding hosts from lb calculations until initial health check #6794
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
Merged
Merged
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
3293441
upstream: exclude hosts from lb calculations until first active hc re…
fd70113
fix upstream tests
83f454b
fix locality test
f7b142f
add test for zero warmed in locality
8d0b343
fix most of the tests
75c8a7c
actually adjust panic based on warmed hosts
d94e116
format + other fixes
821913e
fix proto field id + format
9de4c56
spelling + fix load_balancer_benchmark build
0bc3d03
pass whole list of hosts to faclitate subsetting
1cb40f5
fix more build failures
a4a4f10
fix filter bug
ed4eaa7
fix test failures
d881b27
track excluded hosts instead of warmed hosts to reduce memory usage
ce7d5b4
fix cm tests
f017af1
expose const shared ptr, use UpdateHostsParams
5e688e2
remove warmed() function, check flag directly
6b962fd
Merge remote-tracking branch 'envoy/master' into warm-new-hosts
8c33216
add integration test + stats
ab918c3
add UTs for panic
7950e0b
move params helpers to test + other nits
510a7a9
add UT for partitionHosts
c89bb7b
add version notes
8a9153a
fix more updateHostsParams usages
820cd35
fix format failures
b69d22e
remove redundant this
b79ef40
normalize handling of pending flag, add TODO
1a931fb
increase stats limit
0207652
Merge remote-tracking branch 'envoy/master' into warm-new-hosts
5510ac7
move clearPendingFlag to helper method
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 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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -257,6 +257,15 @@ void HealthCheckerImplBase::ActiveHealthCheckSession::handleSuccess(bool degrade | |
| } | ||
| } | ||
|
|
||
| // Clear the pending flag if it is set. By removing this we're marking the host as having been | ||
|
Member
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. nit: maybe put this logic into a helper function that can be shared here and below? This would keep the comments and reasoning in one place? WDYT? |
||
| // health checked. | ||
| if (host_->healthFlagGet(Host::HealthFlag::PENDING_ACTIVE_HC)) { | ||
| host_->healthFlagClear(Host::HealthFlag::PENDING_ACTIVE_HC); | ||
| // Even though the health value of the host might have not changed, we set this to Changed to | ||
| // that the cluster can update its list of excluded hosts. | ||
| changed_state = HealthTransition::Changed; | ||
| } | ||
|
|
||
| if (degraded != host_->healthFlagGet(Host::HealthFlag::DEGRADED_ACTIVE_HC)) { | ||
| if (degraded) { | ||
| host_->healthFlagSet(Host::HealthFlag::DEGRADED_ACTIVE_HC); | ||
|
|
@@ -307,6 +316,15 @@ HealthTransition HealthCheckerImplBase::ActiveHealthCheckSession::setUnhealthy( | |
| } | ||
| } | ||
|
|
||
| // Clear the pending flag if it is set. By removing this we're marking the host as having been | ||
| // health checked. | ||
| if (host_->healthFlagGet(Host::HealthFlag::PENDING_ACTIVE_HC)) { | ||
| host_->healthFlagClear(Host::HealthFlag::PENDING_ACTIVE_HC); | ||
| // Even though the health value of the host didn't change, we set this to Changed to that the | ||
| // cluster can update its list of excluded hosts. | ||
| changed_state = HealthTransition::Changed; | ||
|
mattklein123 marked this conversation as resolved.
Outdated
|
||
| } | ||
|
|
||
| if ((first_check_ || parent_.always_log_health_check_failures_) && parent_.event_logger_) { | ||
| parent_.event_logger_->logUnhealthy(parent_.healthCheckerType(), host_, type, first_check_); | ||
| } | ||
|
|
||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.