Introduce virtual host snapshots - #6105
Merged
Merged
Conversation
Contributor
ikhoon
approved these changes
Feb 19, 2025
minwoox
approved these changes
Mar 25, 2025
|
|
||
| @Override | ||
| void doOnChanged(VirtualHostXdsResource resource) { | ||
| pending.clear(); |
Contributor
There was a problem hiding this comment.
In RouteResourceNode, we call virtualHostSnapshots.clear(); where as we call pending.clear(); here. Is this intentional?
Contributor
Author
There was a problem hiding this comment.
Good point, updated both implementations to just clear both data structures
trustin
approved these changes
Mar 25, 2025
trustin
left a comment
Contributor
There was a problem hiding this comment.
Mostly nits. Looks good!
Contributor
Author
|
Let me go ahead and merge this PR, thanks for the review all |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation:
We are planning on deprecating
XdsEndpointGroupand introducingXdsPreprocessorat #6096.Previously,
XdsEndpointGroupcreated sub-EndpointGroups which consume resources. (e.g.HealthCheckedEndpointGroup,DnsEndpointGroup, etc..) assuming that all xDS clients will share a commonEndpointGroup.However,
XdsPreprocessorcannot be shared among all client types.For instance, thrift clients will need to use
RpcPreprocessorwhereas web clients will need to use normalPreprocessors.I propose that
XdsBootstrapcontains a singleClusterManagerwhich caches allEndpointGroups derived fromClusters. ThisClusterManageris aligned with the xDS API cluster_manager and is aligned with the upstream implementation as well.One prerequisite for the introduction of
ClusterManageris the ability to cacheClusters. This is difficult since the current implementation ofClusterSnapshotalso contains a reference to the containingRoute.armeria/xds/src/main/java/com/linecorp/armeria/xds/ClusterSnapshot.java
Line 82 in 533f798
I propose that
VirtualHostSnapshotandRouteEntryis introduced, and snapshot mappings are unidirectional. This direction aligns with a possible future implementation of VHDS as well.As this is a refactor of the previous implementation, there is no expected change in behavior except for subset load balancing (which actually matches upstream now)
Modifications:
VirtualHostSnapshotwhich is equivalent toVirtualHost, andRouteEntrywhich is equivalent toRoute.ClusterManagerandSubsetLoadBalancerto not useClusterSnapshot#routeSubsetLoadBalancernow is aligned with the upstream implementation (ref)ConfigSourceMapperimplementation by removing unused fields and the corresponding logic.Result:
ClusterSnapshotAPI is prepared for the introduction of a centralClusterManagermaintained byXdsBootstrapImpl