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

how could I start a spontaneous DeltaDiscoveryRequests in my own extension? #8948

Closed
aaron-ai opened this issue Nov 8, 2019 · 7 comments
Closed
Labels
question Questions that are neither investigations, bugs, nor enhancements stale stalebot believes this issue/PR has not been touched recently

Comments

@aaron-ai
Copy link
Member

aaron-ai commented Nov 8, 2019

I saw that envoy added delta cds support in the latest release version. the official docs showed that envoy client could start a spontaneous DeltaDiscoveryRequests to the discovery service.

(delta xds) Allows the Envoy to on-demand / lazily request additional resources. For example, requesting a cluster only when a request for that cluster arrives.

we developed an extension for our middleware in our team, but we did not intent to allocate all cds resources, because the price ( the large size of "state-of-the-world" resources ) was too heavy to afford. so we wanted to start a spontaneous DeltaDiscoveryRequests when the envoy proxy was running (not at the start of envoy).

I queried the source code of envoy, and I did not find the appropriate api to call in our extension. what should I do to solve this problem ?

@mattklein123 mattklein123 added the question Questions that are neither investigations, bugs, nor enhancements label Nov 8, 2019
@mattklein123
Copy link
Member

What you are asking for is what we are calling "on demand" vs. "basic delta xDS."

I'm not sure of the current status of "on demand." AFAIK OSS development hasn't started for anything other than VHDS. cc @htuch @wgallagher @fredlas

@fredlas
Copy link
Contributor

fredlas commented Nov 8, 2019

Adding @dmitri-d, the author of the VHDS work.

@htuch
Copy link
Member

htuch commented Nov 8, 2019

We have most of the hooks in place for on-demand CDS, as we have built this internally at Google.

addThreadLocalClusterUpdateCallbacks(ClusterUpdateCallbacks&) override;
is key to this. But, it would be awesome if someone implements the on-demand CDS in xDS as specified. When VHD settles, that should have already thrashed out some of the issues you're likely to hit.

@aaron-ai
Copy link
Member Author

aaron-ai commented Nov 9, 2019

We have most of the hooks in place for on-demand CDS, as we have built this internally at Google.

addThreadLocalClusterUpdateCallbacks(ClusterUpdateCallbacks&) override;

is key to this. But, it would be awesome if someone implements the on-demand CDS in xDS as specified. When VHD settles, that should have already thrashed out some of the issues you're likely to hit.

Thanks. your answer clear up my confusion to some extent.

if I expose updateResourceInterest in class ClusterManager through cds_api_:

in cds_api_impl.h, I added:

void updateClusterInterest(const std::set<std::string>& update_to_these_names) override {
  subscription_->updateResourceInterest(update_to_these_names);
}

and I set api_type in ADS to DELTA_GRPC, then I can call updateClusterInterest to notify GRPC server to transfer the cluster resource I need, is this an appropriate approach ? @fredlas @htuch

@htuch
Copy link
Member

htuch commented Nov 11, 2019

I think this is the right direction, but you probably don't want to expose the ability to change the full resource set; instead, you want to have an additive method, i.e. addClusterToInterest

@stale
Copy link

stale bot commented Dec 11, 2019

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label Dec 11, 2019
@stale
Copy link

stale bot commented Dec 18, 2019

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

@stale stale bot closed this as completed Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions that are neither investigations, bugs, nor enhancements stale stalebot believes this issue/PR has not been touched recently
Projects
None yet
Development

No branches or pull requests

4 participants