-
Notifications
You must be signed in to change notification settings - Fork 3.9k
xds: ORCA to LRS propagation changes #12203
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
base: master
Are you sure you want to change the base?
Conversation
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'd have to look at some details more closely, but it is mostly just plumbing.
@@ -25,6 +25,7 @@ | |||
import com.google.common.collect.Sets; | |||
import io.grpc.Internal; | |||
import io.grpc.Status; | |||
import io.grpc.xds.BackendMetricPropagation; |
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.
io.grpc.xds.client can't depend on io.grpc.xds. We moved client into its own package so it could be used without the rest of grpc.
@@ -420,6 +421,29 @@ public void run() { | |||
return loadCounter; | |||
} | |||
|
|||
@Override | |||
public LoadStatsManager2.ClusterLocalityStats addClusterLocalityStats( |
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.
Shouldn't the old method just call this one with backendMetricPropagation
set to null
? (Feel free to do that in XdsClient.java)
namedMetricKeysBuilder.add(metricKey); | ||
} | ||
} | ||
break; |
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.
Why is this required ?
Map<String, Struct> filterMetadata, @Nullable BackendMetricPropagation backendMetricPropagation, | ||
@Nullable OutlierDetection outlierDetection, Object endpointLbConfig, | ||
LoadBalancerRegistry lbRegistry, Map<String, | ||
Map<Locality, Integer>> prioritizedLocalityWeights, List<DropOverload> dropOverloads) { |
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.
nit: Can we add backendMetricPropagation param to the end of the methods for better consistency ?
@@ -326,7 +336,7 @@ private static StructOrError<CdsUpdate.Builder> parseNonAggregateCluster( | |||
|
|||
return StructOrError.fromStruct(CdsUpdate.forEds( | |||
clusterName, edsServiceName, lrsServerInfo, maxConcurrentRequests, upstreamTlsContext, | |||
outlierDetection, isHttp11ProxyAvailable)); | |||
outlierDetection, isHttp11ProxyAvailable, backendMetricPropagation)); |
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.
nit: indentation
return StructOrError.fromStruct(CdsUpdate.forLogicalDns( | ||
clusterName, dnsHostName, lrsServerInfo, maxConcurrentRequests, | ||
upstreamTlsContext, isHttp11ProxyAvailable)); | ||
upstreamTlsContext, isHttp11ProxyAvailable, backendMetricPropagation)); |
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.
nit: indentation
if (memUtilization > 0) { | ||
boolean shouldPropagate = true; | ||
if (backendMetricPropagation != null) { | ||
shouldPropagate = backendMetricPropagation.propagateMemUtilization; | ||
} | ||
|
||
if (shouldPropagate) { | ||
String metricName = "mem_utilization"; | ||
if (!loadMetricStatsMap.containsKey(metricName)) { | ||
loadMetricStatsMap.put(metricName, new BackendLoadMetricStats(1, memUtilization)); | ||
} else { | ||
loadMetricStatsMap.get(metricName).addMetricValueAndIncrementRequestsFinished(memUtilization); | ||
} | ||
} | ||
} |
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.
Can this be extracted out to a separate function ?
Implements gRFC A85 (grpc/proposal#454).
TODO: Unit tests