Skip to content

Implement A61 update to remove special case for LOGICAL_DNS clusters #8379

Closed as duplicate of#8153
@arjan-bal

Description

@arjan-bal

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:

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions