-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
delta cds: add on-demand cds support. #8984
Conversation
6186a92
to
a5a0867
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a heads up, the actual clean version of the gRPC xDS client code, which will give you a nice firm footing to build off of, is what is being un-reverted by #8974. Fortunately, the merge conflicts will be 100% mechanical: the actual interesting logic you're building on in the delta part is already in place. There will just be a little file renaming and whatnot.
@@ -39,6 +39,12 @@ void DeltaSubscriptionImpl::updateResourceInterest( | |||
stats_.update_attempt_.inc(); | |||
} | |||
|
|||
void DeltaSubscriptionImpl::addResourceInterest(const std::set<std::string>& add_these_names) { | |||
watch_ = context_->addOrUpdateWatch(type_url_, watch_, add_these_names, *this, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think GrpcMux::addOrUpdateWatch
does what you are needing it to do. You are trying to use it as "add TO the existing watch", but what it's actually going to do is just overwrite with add_these_names. The "add" part of "addOrUpdateWatch" means "add a watch to the map if there was none" (i.e. the watch argument is nullptr).
So, looks like this function was named entirely from the point of view of someone (i.e. me) implementing GrpcMux and WatchMap, rather than what would make sense for an external user. My apologies! Maybe it should just be called updateWatch
.
Anyways, I think what you need to do is add a function to WatchMap. I think what you want is to give WatchMap::updateWatchInterest
a sibling, maybe WatchMap::addToWatchInterest
, that basically does the exact same as what updateWatchInterest does, except newly_added_to_watch
is just the input argument, and newly_removed_from_watch
is the empty set.
Thanks for reply !! I will fix it. |
d8f227e
to
6e8cccb
Compare
Signed-off-by: aaron-ai <yangkun.ayk@alibaba-inc.com>
Signed-off-by: aaron-ai <yangkun.ayk@alibaba-inc.com>
Signed-off-by: aaron-ai <yangkun.ayk@alibaba-inc.com>
I think the CdsApi require the watch interface but Iam not sure if I understand your full picture. Your goal is to reduce the interested cluster, but the existing CdsApi is implicitly subscribe ALL clusters. The code is vague if you want to use
I think above is the first step before we dive deeper |
Thanks, I just want to use one CdsApi instance for our need. and when I use DELTA_GRPC, our GRPC discovery service will only return the CDS resource we subscribe spontaneously. |
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Description: this PR allows user can start a spontaneous DeltaDiscoveryRequests for cds (AKA on-demand cds) by using
addToClusterInterest
orupdateClusterInterest
incluster_manager
.Risk Level: Low
Testing: Unit Tests
Docs Changes: N/A
Release Notes: N/A
[Optional Fixes #Issue]: #8948