xds: fix for delta xDS reconnect bug in LDS/CDS#12174
Merged
Conversation
when the envoy sidecar get disconnected from the xds stream, the reconnecting request will contain `InitialResourceVersions` and `ResourceNamesSubscribe`. This is OK for endpoint and route type, as these two are driven by (child types of) cluster and listener type respectively. However, register `cluster` type as subscription instead of wildcard would cause envoy not able to get any new cluster updates for the rest of this life. Same goes for `listener`. This pr is to always set cluster and listener type to wildcard, to ensure the envoy sidecar will get those updates after disconnecting from xds stream for whatever reason (network blip/consul restart/etc).
rboyer
commented
Jan 24, 2022
| } | ||
| } | ||
|
|
||
| if handler, ok := handlers[req.TypeUrl]; ok { |
Member
Author
There was a problem hiding this comment.
Need to move this to after the version-sniff so we can use the detected version to change behavior.
kisunji
reviewed
Jan 24, 2022
Contributor
kisunji
left a comment
There was a problem hiding this comment.
Some Qs about clarity in comments
kisunji
approved these changes
Jan 25, 2022
Collaborator
|
🍒 If backport labels were added before merging, cherry-picking will start automatically. To retroactively trigger a backport after merging, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/564788. |
Collaborator
|
🍒✅ Cherry pick of commit d2c0945 onto |
hc-github-team-consul-core
pushed a commit
that referenced
this pull request
Jan 25, 2022
When a wildcard xDS type (LDS/CDS/SRDS) reconnects from a delta xDS stream, prior to envoy `1.19.0` it would populate the `ResourceNamesSubscribe` field with the full list of currently subscribed items, instead of simply omitting it to infer that it wanted everything (which is what wildcard mode means). This upstream issue was filed in envoyproxy/envoy#16063 and fixed in envoyproxy/envoy#16153 which went out in Envoy `1.19.0` and is fixed in later versions (later refactored in envoyproxy/envoy#16855). This PR conditionally forces LDS/CDS to be wildcard-only even when the connected Envoy requests a non-wildcard subscription, but only does so on versions prior to `1.19.0`, as we should not need to do this on later versions. This fixes the failure case as described here: #11833 (comment) Co-authored-by: Huan Wang <[email protected]>
Collaborator
rboyer
added a commit
that referenced
this pull request
Jan 25, 2022
When a wildcard xDS type (LDS/CDS/SRDS) reconnects from a delta xDS stream, prior to envoy `1.19.0` it would populate the `ResourceNamesSubscribe` field with the full list of currently subscribed items, instead of simply omitting it to infer that it wanted everything (which is what wildcard mode means). This upstream issue was filed in envoyproxy/envoy#16063 and fixed in envoyproxy/envoy#16153 which went out in Envoy `1.19.0` and is fixed in later versions (later refactored in envoyproxy/envoy#16855). This PR conditionally forces LDS/CDS to be wildcard-only even when the connected Envoy requests a non-wildcard subscription, but only does so on versions prior to `1.19.0`, as we should not need to do this on later versions. This fixes the failure case as described here: #11833 (comment) Co-authored-by: Huan Wang <[email protected]>
rboyer
added a commit
that referenced
this pull request
Jan 25, 2022
When a wildcard xDS type (LDS/CDS/SRDS) reconnects from a delta xDS stream, prior to envoy `1.19.0` it would populate the `ResourceNamesSubscribe` field with the full list of currently subscribed items, instead of simply omitting it to infer that it wanted everything (which is what wildcard mode means). This upstream issue was filed in envoyproxy/envoy#16063 and fixed in envoyproxy/envoy#16153 which went out in Envoy `1.19.0` and is fixed in later versions (later refactored in envoyproxy/envoy#16855). This PR conditionally forces LDS/CDS to be wildcard-only even when the connected Envoy requests a non-wildcard subscription, but only does so on versions prior to `1.19.0`, as we should not need to do this on later versions. This fixes the failure case as described here: #11833 (comment) Co-authored-by: Huan Wang <[email protected]> Co-authored-by: Huan Wang <[email protected]>
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.
When a wildcard xDS type (LDS/CDS/SRDS) reconnects from a delta xDS stream, prior to envoy
1.19.0it would populate theResourceNamesSubscribefield with the full list of currently subscribed items, instead of simply omitting it to infer that it wanted everything (which is what wildcard mode means).This upstream issue was filed in envoyproxy/envoy#16063 and fixed in envoyproxy/envoy#16153 which went out in Envoy
1.19.0and is fixed in later versions (later refactored in envoyproxy/envoy#16855).This PR conditionally forces LDS/CDS to be wildcard-only even when the connected Envoy requests a non-wildcard subscription, but only does so on versions prior to
1.19.0, as we should not need to do this on later versions.This replaces PR #12160 by @fredwangwang that solved the failure case as described here: #11833 (comment)