-
Notifications
You must be signed in to change notification settings - Fork 5.3k
config: unification of delta and SotW gRPC xDS #8478
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 all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
8798a7b
initial totally broken mid-merge commit
fredlas 10b91ec
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas 2a2d53d
xds sotw and delta unification almost entirely compiling
fredlas 7f9c324
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas 0a8d087
much of ads_integration_test passes, support skip_subsequent_node
fredlas f351797
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas 2b5109c
incorporate PR 7427 init timeout disable
fredlas 42186ec
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas 282d346
WatchMap changes from PR 8350
fredlas bce3da0
PR 8334
fredlas df64fc9
add to the mock gRPC version of the protobuf matchers
fredlas 9d79ab8
all config unit tests pass, found some moderate differences from old …
fredlas 9392d0b
merge conflict
fredlas 4cf6dab
passes scoped_rds and vhds with stat commented out
fredlas 28f5983
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas 676d467
reenable segfaulting stat access, reshuffle onConfigUpdate update_att…
fredlas 5e99a08
merge conflict
fredlas 7398569
make the update_attempt_ TODOs actual TODOs, since it should be its o…
fredlas 75c8ed4
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas 19f990f
initial rough merge of the now-in-master 7293
fredlas f51d3c2
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas 4f7b1e7
get github to diff grpc_mux_impl against new_grpc_mux impl, part 1
fredlas 52c798e
get github to diff grpc_mux_impl against new_grpc_mux impl, part 2
fredlas 96ce9f0
get github to diff grpc_mux_impl against new_grpc_mux impl, part 3
fredlas 7d0904e
is_delta removed from everywhere, new sotw_sub_state_test passes
fredlas 4ea4ef3
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas 0e9a90d
everything passes except integration framework lifetimes bug
fredlas 979dfcd
merge conflict
fredlas c8d159f
GrpcMuxImpl back to NewGrpcMuxImpl for cleaner diff
fredlas fdb501c
rename class GrpcMuxImpl to NewGrpcMuxImpl
fredlas b9a6b0b
reorder NewGrpcMuxImpl and split Delta and Sotw out of header
fredlas 938388f
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas 1c1f447
clean up remaining delta-specific cruft
fredlas 13c9b43
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas f83d1e6
fully cleaned up, only lifetimes problem left
fredlas c779600
simplify queue size stat setting
fredlas 1d7bd93
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas a7c3bd3
all tests passing
fredlas b40acce
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas 008ca2d
remove unneeded extra line
fredlas 075b362
fix typos
fredlas 0040f36
format and tidy fixes
fredlas b8abeea
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas 675f3a8
additional things the pedantic spell check thing disliked without act…
fredlas 3165074
maybe it needs the punctuation too, if this doesnt work i will disabl…
fredlas 0961ce8
add grpc_mux.h comments
fredlas f7ddff5
merge conflict
fredlas 4350f2d
clean up some TODOs
fredlas 0ddf5db
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas 1f682e7
fix compilation, BUILD proto dependencies have a new format
fredlas 0ff6538
check_spelling_pedantic appears to crash when i add the punctuated wo…
fredlas b813715
review comments
fredlas e2c54d4
merge conflict
fredlas a7693c3
remove outdated comment
fredlas b893c17
change comments to work around broken pedantic spell checker
fredlas ed532b9
merge conflict
fredlas fbc907d
undo merge accident yaml json
fredlas 98ddbc7
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas 61da213
add comments about callbacks being a WatchMap
fredlas 45e5e96
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas 048cee4
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas 8e80da9
merge conflict
fredlas 1594fd7
Merge remote-tracking branch 'upstream/master' into unified_ADS
fredlas 74033fa
remove isDelta
fredlas 1e4ada5
spellcheck
fredlas 25f6163
resolve merge
fredlas 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,39 +9,51 @@ you can mostly forget the filesystem/REST/gRPC distinction, and you can | |
| especially forget about the gRPC flavors. All of that is specified in the | ||
| bootstrap config, which is read and put into action by ClusterManagerImpl. | ||
|
|
||
| Note that there can be multiple active gRPC subscriptions for a single resource | ||
|
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. @wgallagher in a follow up change can we move this doc to source/docs where our dev docs go and/or figure out if this should be merged into the RST docs? |
||
| type. This concept is called "resource watches". If one EDS subscription | ||
| subscribes to X and Y, and another subscribes to Y and Z, the underlying | ||
| subscription logic will maintain a subscription to the union: X Y and Z. Updates | ||
| to X will be delivered to the first object, Y to both, Z to the second. This | ||
| logic is implemented by WatchMap. | ||
|
|
||
| ### If you are working on Envoy's gRPC xDS client logic itself, read on. | ||
| ## If you are working on Envoy's gRPC xDS client logic itself, read on. | ||
|
|
||
| When using gRPC, xDS has two pairs of options: aggregated/non-aggregated, and | ||
| delta/state-of-the-world updates. All four combinations of these are usable. | ||
|
|
||
| ## Aggregated (ADS) vs not (xDS) | ||
|
|
||
| "Aggregated" means that EDS, CDS, etc resources are all carried by the same gRPC stream. | ||
| For Envoy's implementation of xDS client logic, there is effectively no difference | ||
| between aggregated xDS and non-aggregated: they both use the same request/response protos. The | ||
| non-aggregated case is handled by running the aggregated logic, and just happening to only have 1 | ||
| xDS subscription type to "aggregate", i.e., NewGrpcMuxImpl only has one | ||
| DeltaSubscriptionState entry in its map. | ||
| xDS subscription type to "aggregate", i.e., GrpcMux only has one SubscriptionState | ||
| entry in its map. | ||
|
|
||
| However, to the config server, there is a huge difference: when using ADS (caused | ||
| by the user providing an ads_config in the bootstrap config), the gRPC client sets | ||
| its method string to {Delta,Stream}AggregatedResources, as opposed to {Delta,Stream}Clusters, | ||
| {Delta,Stream}Routes, etc. So, despite using the same request/response protos, | ||
| and having identical client code, they're actually different gRPC services. | ||
|
|
||
| Delta vs state-of-the-world is a question of wire format: the protos in question are named | ||
| [Delta]Discovery{Request,Response}. That is what the GrpcMux interface is useful for: its | ||
| NewGrpcMuxImpl (TODO may be renamed) implementation works with DeltaDiscovery{Request,Response} and has | ||
| delta-specific logic; its GrpxMuxImpl implementation (TODO will be merged into NewGrpcMuxImpl) works with Discovery{Request,Response} | ||
| and has SotW-specific logic. Both the delta and SotW Subscription implementations (TODO will be merged) hold a shared_ptr<GrpcMux>. | ||
| The shared_ptr allows for both non- and aggregated: if non-aggregated, you'll be the only holder of that shared_ptr. | ||
| ## Delta vs state-of-the-world (SotW) | ||
|
|
||
| Delta vs state-of-the-world is a question of wire format and protocol behavior. | ||
| The protos in question are named [Delta]Discovery{Request,Response}. GrpcMux can work | ||
| with either pair. Almost all GrpcMux logic is in the shared GrpcMuxImpl base class; | ||
| SotwGrpcMux and DeltaGrpcMux exist to be adapters for the specific protobuf types, since | ||
| protobufs are not amenable to polymorphism. | ||
|
|
||
|  | ||
| All delta/SotW specific logic is handled by GrpcMux and SubscriptionState. GrpcSubscriptionImpl | ||
| simply holds a shared_ptr to a GrpcMux interface; it has no need to know about delta vs SotW. | ||
|
|
||
| Note that the orange flow does not necessarily have to happen in response to the blue flow; there can be spontaneous updates. ACKs are not shown in this diagram; they are also carred by the [Delta]DiscoveryRequest protos. | ||
| What does GrpcXdsContext even do in this diagram? Just own things and pass through function calls? Answer: it sequences the requests and ACKs that the various type_urls send. | ||
|  | ||
|
|
||
| The orange flow does not necessarily have to happen in response to the blue flow; there can be | ||
| spontaneous updates. ACKs are not shown in this diagram; they are also carried by the | ||
| [Delta]DiscoveryRequest protos. | ||
|
|
||
| What does GrpcMux even do in this diagram? Just own things and pass through function calls? | ||
| Answer: 1) it sequences the requests and ACKs that the various type_urls send, 2) it handles the | ||
| protobuf vs polymorphism impedance mismatch, allowing all delta-vs-SotW-agnostic code | ||
| to be reused. | ||
|
|
||
| Note that there can be multiple active gRPC subscriptions for a single resource | ||
| type. This concept is called "resource watches". If one EDS subscription | ||
| subscribes to X and Y, and another subscribes to Y and Z, the underlying | ||
| subscription logic will maintain a subscription to the union: X Y and Z. Updates | ||
| to X will be delivered to the first object, Y to both, Z to the second. This | ||
| logic is implemented by WatchMap. | ||
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.