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

ads: pause and resume v3 apis #11300

Merged
merged 16 commits into from
Jun 17, 2020
Merged

Conversation

sschepens
Copy link
Contributor

Pause and resune V3 Api Verions as well as V2 when using ads.

Currently only V2 Api is being paused, this causes envoy to send a separate discovery request for every resource on CDS/LDS/SRDS updates.

Risk Level: Medium?
Testing:
Fixes: #11267

Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
@htuch htuch self-assigned this May 24, 2020
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.

Thanks. Patch looks good but I wonder we should probably leave a TODO to make this a bit more robust by allowing pause/resume of the latest message type and then chain backwards inside the pause/resume implementation to cover earlier versions.

On the test front, this behavior does have tests, e.g. see #1991. Most of the ones that matter in that PR were the integration tests, but it should be possible to do unit/mock tests as well if that's simpler.
/wait

@sschepens
Copy link
Contributor Author

@htuch i'd like to make integration tests with v3, i was thinking about adding a parameter the integration tests (as with delta vs sotw) and making the whole suit run with v2 and v3. Does that seem correct?

@htuch
Copy link
Member

htuch commented May 27, 2020

@sschepens the tests are pretty slow, so if we do this for all the ADS integration tests, that might be a bit much. You can parameterize on v2/v3 resource type for just a pause/resume test, subclassing AdsIntegrationTest.

sschepens added 2 commits June 1, 2020 16:56
Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
@sschepens
Copy link
Contributor Author

@htuch sorry for the delay, had a hard time understanding why the test i created was failing, had to duplicate some logic to be able to send v3 messages in integration tests, don't know if that's ok though

Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
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.

Thanks, a few comments. I think it's going to be very desirable to avoid the copy+paste.
/wait

source/common/router/scoped_rds.cc Outdated Show resolved Hide resolved
source/common/router/scoped_rds.cc Outdated Show resolved Hide resolved
source/common/upstream/cluster_manager_impl.cc Outdated Show resolved Hide resolved
test/integration/ads_integration_test.cc Outdated Show resolved Hide resolved
Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
@howardjohn
Copy link
Contributor

fixes #11512

Thanks!

Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
@sschepens
Copy link
Contributor Author

@htuch clang_tidy is complaining about the case for the static function AdsIntegrationConfig i'll lowercase the first letter to fix this

Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
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.

Yep, the approach taken here looks good. Would be good to figure out if we can get rid of some of the remaining boiler plate in AdsClusterV3 test, but this is on the right track IMHO.

include/envoy/config/grpc_mux.h Outdated Show resolved Hide resolved
source/common/upstream/cluster_manager_impl.cc Outdated Show resolved Hide resolved
test/integration/ads_integration.cc Outdated Show resolved Hide resolved
sendDeltaDiscoveryResponse(type_url, added_or_updated, removed, version, xds_stream_);
}

template <class T>
Copy link
Member

Choose a reason for hiding this comment

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

Why are these templated? Aren't they all v3? Do we need these wrappers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are templated because they receive any type of proto message to encode in the response.
I needed to create these to enforce V3 DiscoveryResponses

Copy link
Member

Choose a reason for hiding this comment

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

I'm still a bit confused; these belong to AdsClusterV3Test, which is only doing v3 AFAICT. So, why do they need templating?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The templating is not for the api version but for the resource type this methods receive clusters, cluster load assignements, routes, etc.

Copy link
Member

Choose a reason for hiding this comment

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

I'm still wondering if we really need these. There is a transport/resource version distinction in xDS, here we only care about v3 xDS resource API version, there should be no need to have specialized methods for the v3 API transport to validate the pause/resume behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the reason i added these is to override the default resource version downgrading here and here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i could probably make those two methods virtual and override only those, would that be ok?

Copy link
Member

Choose a reason for hiding this comment

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

Sure, or even just parameterize the downgrade in the function args.

test/integration/ads_integration_test.cc Outdated Show resolved Hide resolved
Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
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.

Other than the thread on ADS integration test, this looks awesome and ready to ship! Thanks for iterating.

sendDeltaDiscoveryResponse(type_url, added_or_updated, removed, version, xds_stream_);
}

template <class T>
Copy link
Member

Choose a reason for hiding this comment

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

I'm still wondering if we really need these. There is a transport/resource version distinction in xDS, here we only care about v3 xDS resource API version, there should be no need to have specialized methods for the v3 API transport to validate the pause/resume behavior.

Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
@sschepens
Copy link
Contributor Author

@htuch addressed the last comment and added another batching test, let me know if that's ok

htuch
htuch previously approved these changes Jun 16, 2020
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.

Awesome! Thanks @sschepens for iterating on this. This will have a real benefit to users of v3.

Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
@htuch htuch merged commit 9aa85a3 into envoyproxy:master Jun 17, 2020
@sschepens sschepens deleted the ads-pause-unpause-v3 branch June 17, 2020 18:35
yashwant121 pushed a commit to yashwant121/envoy that referenced this pull request Jun 24, 2020
Pause and resune V3 Api Verions as well as V2 when using ads.

Currently only V2 Api is being paused, this causes envoy to send a separate discovery request for every resource on CDS/LDS/SRDS updates.

Risk Level: Medium?
Testing:

Fixes: envoyproxy#11267

Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
Signed-off-by: yashwant121 <yadavyashwant36@gmail.com>
songhu pushed a commit to songhu/envoy that referenced this pull request Jun 25, 2020
Pause and resune V3 Api Verions as well as V2 when using ads.

Currently only V2 Api is being paused, this causes envoy to send a separate discovery request for every resource on CDS/LDS/SRDS updates.

Risk Level: Medium?
Testing:

Fixes: envoyproxy#11267

Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
ggreenway pushed a commit that referenced this pull request Jul 6, 2020
Add mocks to MockGrpcMuxWatch. follow-up to #11300.

Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
yashwant121 pushed a commit to yashwant121/envoy that referenced this pull request Jul 24, 2020
Pause and resune V3 Api Verions as well as V2 when using ads.

Currently only V2 Api is being paused, this causes envoy to send a separate discovery request for every resource on CDS/LDS/SRDS updates.

Risk Level: Medium?
Testing:

Fixes: envoyproxy#11267

Signed-off-by: Sebastian Schepens <sebastian.schepens@mercadolibre.com>
Signed-off-by: yashwant121 <yadavyashwant36@gmail.com>
scheler pushed a commit to scheler/envoy that referenced this pull request Aug 4, 2020
Add mocks to MockGrpcMuxWatch. follow-up to envoyproxy#11300.

Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Signed-off-by: scheler <santosh.cheler@appdynamics.com>
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.

ads: Envoy sending DeltaDiscoveryRequest for each EDS resource
4 participants