-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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: ignore routes with unsupported cluster specifiers #5269
Conversation
d915a48
to
dd11bf9
Compare
dd11bf9
to
0e5f90d
Compare
cspNames[a.ClusterSpecifierPlugin] = true | ||
route.ClusterSpecifierPlugin = a.ClusterSpecifierPlugin | ||
default: | ||
return nil, nil, fmt.Errorf("route %+v, has an unknown ClusterSpecifier: %+v", r, a) | ||
logger.Warningf("route %+v references unknown ClusterSpecifier %+v, the route will be ignored", r, a) |
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.
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 based this warning log off what was currently in the codebase with regards to ignoring routes. Let me know, I'll leave for now.
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'm concerned this will become log spam. Is there precedent for logging (at higher priority than INFO) when we get an xDS response we would eventually ACK?
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.
Switched to INFO, as per discussed in QAZSE.
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.
Thanks for the comments :D!
cspNames[a.ClusterSpecifierPlugin] = true | ||
route.ClusterSpecifierPlugin = a.ClusterSpecifierPlugin | ||
default: | ||
return nil, nil, fmt.Errorf("route %+v, has an unknown ClusterSpecifier: %+v", r, a) | ||
logger.Warningf("route %+v references unknown ClusterSpecifier %+v, the route will be ignored", r, a) |
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 based this warning log off what was currently in the codebase with regards to ignoring routes. Let me know, I'll leave for now.
@@ -747,7 +817,7 @@ func (mockClusterSpecifierPlugin) TypeURLs() []string { | |||
} | |||
|
|||
func (mockClusterSpecifierPlugin) ParseClusterSpecifierConfig(proto.Message) (clusterspecifier.BalancerConfig, error) { | |||
return nil, nil | |||
return []map[string]interface{}{}, nil |
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.
Note that even this config is not really legal either. It doesn't specify any LB policy name at all. But if it doesn't matter to the tests, it should be okay.
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.
Noted. It used to return nil so I guess it went from one illegal thing to another :).
This PR does a few things: it adds support for the new IsOptional() logic with regards to Cluster Specifier Plugins (if a Cluster Specifier Plugin is optional but not supported, don't NACK, and ignore any routes that point to it). It also changes the behavior of a route that has an unsupported Cluster Specifier. Previously, we would NACK routes that had an unsupported Cluster Specifier, but we now ignore the route.
RELEASE NOTES: None