-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed as duplicate of#8153
Closed as duplicate of#8153
Copy link
Labels
Type: Internal CleanupRefactors, etcRefactors, etc
Description
An update was made to A61 in grpc/proposal#477 to remove the need for hardcoding pick_first
as the child for the priority balancer for logical DNS clusters. The code for this is here:
grpc-go/xds/internal/balancer/clusterresolver/configbuilder.go
Lines 141 to 159 in 6dfe07c
func buildClusterImplConfigForDNS(g *nameGenerator, endpoints []resolver.Endpoint, mechanism DiscoveryMechanism) (string, *clusterimpl.LBConfig, []resolver.Endpoint) { | |
// Endpoint picking policy for DNS is hardcoded to pick_first. | |
const childPolicy = "pick_first" | |
retEndpoints := make([]resolver.Endpoint, len(endpoints)) | |
pName := fmt.Sprintf("priority-%v", g.prefix) | |
for i, e := range endpoints { | |
retEndpoints[i] = hierarchy.SetInEndpoint(e, []string{pName}) | |
// Copy the nested address field as slice fields are shared by the | |
// iteration variable and the original slice. | |
retEndpoints[i].Addresses = append([]resolver.Address{}, e.Addresses...) | |
} | |
return pName, &clusterimpl.LBConfig{ | |
Cluster: mechanism.Cluster, | |
TelemetryLabels: mechanism.TelemetryLabels, | |
ChildPolicy: &internalserviceconfig.BalancerConfig{Name: childPolicy}, | |
MaxConcurrentRequests: mechanism.MaxConcurrentRequests, | |
LoadReportingServer: mechanism.LoadReportingServer, | |
}, retEndpoints | |
} |
We should update the clusterresolver balancer accordingly.
Metadata
Metadata
Assignees
Labels
Type: Internal CleanupRefactors, etcRefactors, etc