Skip to content
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

sds: Ignore Delta Removals #32961

Merged
merged 5 commits into from
Mar 29, 2024
Merged

Conversation

keithmattix
Copy link
Contributor

@keithmattix keithmattix commented Mar 18, 2024

Commit Message: Ignore Delta SDS removals
Additional Description: Fixes #24373 and #32832
Risk Level: Low
Testing: Manual testing with the Istio scenario described in #32832. Investigating how to add a unit test
Docs Changes:
Release Notes: Delta SDS removals will no longer result in a "Missing SDS resources" error message
Platform Specific Features:

Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling this issue!
Overall I think this is ok, but I think more tests are needed.
Specifically I think we need to ensure that the owning cluster/listener are actually removing the resource prior to receiving a response with a removed_resources,
and tests that exercise the different validation paths.

source/common/secret/sds_api.cc Outdated Show resolved Hide resolved
source/common/secret/sds_api.cc Outdated Show resolved Hide resolved
source/common/secret/sds_api.cc Outdated Show resolved Hide resolved
source/common/secret/sds_api.cc Show resolved Hide resolved
@keithmattix
Copy link
Contributor Author

Thanks for the review @adisuissa!

Specifically I think we need to ensure that the owning cluster/listener are actually removing the resource prior to receiving a response with a removed_resources,
and tests that exercise the different validation paths.

I'm still getting up to speed on Envoy's testing approaches; is there a section of the integration tests that allow testing the dependent resource flow (specifically with SDS)?

@adisuissa
Copy link
Contributor

I'm still getting up to speed on Envoy's testing approaches; is there a section of the integration tests that allow testing the dependent resource flow (specifically with SDS)?

There are a bunch of tests in https://github.com/envoyproxy/envoy/blob/main/test/integration/sds_dynamic_integration_test.cc and in https://github.com/envoyproxy/envoy/blob/main/test/integration/sds_generic_secret_integration_test.cc.
There's an xDS upstream that sends updates to the Envoy.

If you want to look at a more comprehensive test that includes many xDS types that are delivered to the Envoy, then the ads_integration_test.cc would probably be where they are, but I cannot recall if there are tests covering SDS there.

@keithmattix
Copy link
Contributor Author

Specifically I think we need to ensure that the owning cluster/listener are actually removing the resource prior to receiving a response with a removed_resources,

I added an integration test that I think covers this; I'd appreciate feedback! I also modified the implementation so that removing a secret won't complete cluster warming.

Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, thanks!
Left on comment on the organization of the integration test, but otherwise LGTM.

source/common/secret/sds_api.h Outdated Show resolved Hide resolved
test/integration/ads_integration_test.cc Show resolved Hide resolved
@adisuissa
Copy link
Contributor

Assigning Harvey as a senior-maintainer reviewer in the domain.
/assign @htuch

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
adisuissa
adisuissa previously approved these changes Mar 25, 2024
Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!
One minor comment.

test/integration/ads_integration_test.cc Outdated Show resolved Hide resolved
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
@keithmattix
Copy link
Contributor Author

/retest

3 similar comments
@keithmattix
Copy link
Contributor Author

/retest

@keithmattix
Copy link
Contributor Author

/retest

@keithmattix
Copy link
Contributor Author

/retest

adisuissa
adisuissa previously approved these changes Mar 28, 2024
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is right - if you look at what eds.cc is doing, it just ignores the removed resources for delta. LGTM modulo comments.

source/common/secret/sds_api.cc Show resolved Hide resolved

if (removed_resources.size() == 1) {
// We only removed a resource here; don't go through the SotW init process
// and expect this to be cleaned up by the owning cluster or listener.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please expand on the comment here. I think the key idea is this is a singleton resource subscription, so in normal operation, an xDS server should not be removing the resource until the referencing cluster / listener is no longer using it.

@adisuissa why don't we structurally forbid singleton resource subscriptions from having removals in the baseline xDS infra, wondering why something like SDS needs to worry about this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to enforcing this in the generic xDS machinery. I also think more documentation around "singleton" resources would be helpful as well; in any case, I've expanded the comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely agree that it should be maintained by the xDS infra, although at the moment we have per-type handlers.

Note that singleton resource subscription should not be determined by the type, but by the subscription (unfortunately at the moment it is highly dependent). For SDS, there is a request to support a collection subscription in addition to singletons.

The proposal in #24773 should address this (and other things as well).

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
htuch
htuch previously approved these changes Mar 29, 2024
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
@htuch htuch enabled auto-merge (squash) March 29, 2024 17:29
@htuch htuch merged commit 907e48e into envoyproxy:main Mar 29, 2024
52 of 53 checks passed
@keithmattix keithmattix deleted the sds/support-delta-removal branch March 30, 2024 14:19
alyssawilk pushed a commit to alyssawilk/envoy that referenced this pull request Apr 29, 2024
Fixes envoyproxy#24373 and envoyproxy#32832

Risk Level: Low
Testing: Manual testing with the Istio scenario described in envoyproxy#32832. Investigating how to add a unit test
Release Notes: Delta SDS removals will no longer result in a "Missing SDS resources" error message

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
keithmattix added a commit to istio/community that referenced this pull request Jul 18, 2024
Istio has very few maintainers here and though I'm still learning, I've contributed a handful of upstream envoy PRs as well as 2 recent changes to istio-proxy's telemetry. If existing maintainers have other areas they'd like to see more contributions in, I welcome the feedback!

PRs:
- envoyproxy/envoy#35074
- envoyproxy/envoy#33857
- envoyproxy/envoy#33362
- envoyproxy/envoy#32961
- istio/proxy#5617
- istio/proxy#5514
istio-testing pushed a commit to istio/community that referenced this pull request Jul 19, 2024
Istio has very few maintainers here and though I'm still learning, I've contributed a handful of upstream envoy PRs as well as 2 recent changes to istio-proxy's telemetry. If existing maintainers have other areas they'd like to see more contributions in, I welcome the feedback!

PRs:
- envoyproxy/envoy#35074
- envoyproxy/envoy#33857
- envoyproxy/envoy#33362
- envoyproxy/envoy#32961
- istio/proxy#5617
- istio/proxy#5514
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing SDS resources for 62ab872c-038e-4311-90bc-74a77cda9f53-webserver-certs in onConfigUpdate()
4 participants