-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Xds fallback #11254
base: master
Are you sure you want to change the base?
Xds fallback #11254
Conversation
96cecb2
to
72d9ac9
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.
This is good overall. I finally start to understand the spirit of it.
709026a
to
0c1eef8
Compare
af33b25
to
d8f7094
Compare
Fallback is ready for review again. |
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.
Sending what I have, mostly minor, I haven't looked deep enough.
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.
Sending what I have.
This comment was marked as resolved.
This comment was marked as resolved.
if (ignoreResourceDeletionEnabled && type.isFullStateOfTheWorld() && data != null) { | ||
if (!resourceDeletionIgnored) { | ||
logger.log(XdsLogLevel.FORCE_WARNING, | ||
"xds server {0}: ignoring deletion for resource type {1} name {2}}", | ||
serverInfo.target(), type, resource); | ||
getTarget(), type, resource); |
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.
Instead of re-discovering what caused this, can we just pass ControlPlaneClient, ServerInfo, or target into onAbsent()
? We have that information in the two places we call it.
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.
Changed it to get target from activeCpc.
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 see a reason to use activeCpc
(to call getActiveCpc()
at all). Why re-discover what cpc caused this? It seems easy to add the argument. Would it be a pain to update tests or something like that?
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.
Things done in commit 003348b
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.
Sending what I have.
// try to fallback to lower priority control plane client | ||
if (checkForFallback | ||
&& doFallbackForAuthority( | ||
cpcThatClosed, serverInfo, subscriber.serverInfos, subscriber.authority)) { |
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.
The docs for doFallbackForAuthority()
say server info should be for the active CPC. But here it is identical to cpcThatClosed.getServerInfo()
.
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.
Since we are only trying to do fallback for authorities for which the closed cpc was the active cpc, they are the same. However, since they are the same, and this is the only place that this method is called, there is no reason to pass the serverInfo.
authoritiesForClosedCpc = getActiveAuthorities(cpcThatClosed)
...
if (subscriber.hasResult() || !authoritiesForClosedCpc.contains(subscriber.authority)) {
continue;
}
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.
Sending what I have.
throw new IllegalArgumentException("No xds servers found for authority " + authority); | ||
} | ||
|
||
for (ServerInfo serverInfo : serverInfos) { |
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.
This loop can consider cpcs that aren't currently registered for the authority, but it won't add them to activatedCpClients
. That can cause activatedCpClients
to be corrupted, where cpcs should be registered for the authority but aren't.
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.
It is the manageControlPlaneClient method that is responsible for calling addCpcToAuthority which will add the specified cpc and any missing higher priority ones. So, by the end of manageControlPlaneClient, activatedCpClients will have exactly the cpcs that it should.
4938332
to
f186005
Compare
f186005
to
f304264
Compare
Implementation of https://github.com/grpc/proposal/blob/master/A71-xds-fallback.md in Java