-
Notifications
You must be signed in to change notification settings - Fork 930
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Motivation: It is recommended to review #5802 prior to this PR This changeset attempts to solve several problems: ##### Custom filter logic xDS considers all endpoints when computing whether a `PrioritySet` is in panic state. For instance, if the percentage of unhealthy endpoints exceeds a preconfigured panic threshold, the endpoint selection includes all endpoints regardless of the degraded status. While armeria supports an `HealthCheckedEndpointGroup` out of the box, it filters out healthy endpoints automatically. - https://github.com/line/armeria/blob/72ebfe12abf7804723a490fe7acfe3a45d46089f/xds/src/main/java/com/linecorp/armeria/xds/client/endpoint/DefaultLoadBalancer.java#L99-L105 - ref: https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/panic_threshold In order to resolve this, I propose that a `AbstractHealthCheckedEndpointGroupBuilder#healthCheckedEndpointPredicate` API is added ##### Per-cluster health check configuration Per-cluster member health check is difficult with the current API since a single parameter set is statically defined for an entire health checked endpoint group. - ref: https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/health_checking#per-cluster-member-health-check-config We already have an abstraction `AbstractHealthCheckedEndpointGroupBuilder#newCheckerFactory`. I propose that this API be used for the purpose of xDS. In order to support the parameters xDS allows configuring, I propose that parameters are passed to `HttpHealthChecker` via the constructor instead of the `HealthCheckerContext`. In order to support this change, `HttpHealthChecker` has been moved to an internal package so the `xds` module can also access it. Modifications: - Added APIs `AbstractHealthCheckedEndpointGroupBuilder#healthCheckedEndpointPredicate` and modified `HealthCheckedEndpointGroup` to filter endpoints based on the predicate. - Health checked `Endpoint`s now have attributes `HEALTHY` and `DEGRADED` set. - `HealthCheckedEndpointGroup#setEndpoints` is now called on every invocation of `updateHealth`, not just when a health status changes. - xDS sometimes needs to override the health checked `Endpoint`, so modified to receive health checked parameters from the `HttpHealthChecker` constructor instead of `HealthCheckerContext`. - In the process, `HttpHealthChecker` has been moved to an internal package - `HealthCheckerContext#originalEndpoint` has been added to retrieve the original endpoint. The other APIs haven't been deprecated since it is potentially useful information that other `HealthChecker`s may be using. - Introduced a `XdsHealthCheckedEndpointGroupBuilder` which implements its own `checkerFactory`. - `EndpointUtil#coarseHealth` has been updated to consider `HEALTHY`, `DEGRADED` attributes when determining health. Result: - The behavior of `XdsEndpointGroup` is more aligned with envoy in terms of health checking - Preparation for zone-aware load balancing <!-- Visit this URL to learn more about how to write a pull request description: https://armeria.dev/community/developer-guide#how-to-write-pull-request-description -->
- Loading branch information
Showing
25 changed files
with
1,026 additions
and
165 deletions.
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
Oops, something went wrong.