Skip to content

Upcoming experimental Balancer API changes #4207

Closed
@easwars

Description

@easwars

The balancer API uses important pieces of functionality provided by gRPC via the following interfaces: balancer.ClientConn and balancer.SubConn.

While the balancer.ClientConn interface provides the functionality to create and delete a balancer.SubConn, the functionality to modify the addresses of an existing balancer.SubConn is provided by the balancer.SubConn interface itself. This asymmetry create an unnecessary pain-point for LB policy implementations in a setup with a tree of LB policies.

The proposed API change here is as follows:

  • Extend the balancer.ClientConn interface by providing a way to update addresses of an existing balancer.SubConn.
	// UpdateAddresses updates the addresses used in the passed in SubConn.
	// gRPC checks if the currently connected address is still in the new list.
	// If so, the connection will be kept. Else, the connection will be
	// gracefully closed, and a new connection will be created.
	//
	// This will trigger a state transition for the SubConn.
	UpdateAddresses(SubConn, []resolver.Address)
  • Remove the UpdateAddresses method on the balancer.SubConn interface, which would then provide a single Connect() method.

The plan would be as follows:

  • Add UpdateAddresses() to balancer.ClientConn as part of the 1.37.x release.
  • Remove UpdateAddresses() from balancer.SubConn in a future release. Maybe 1.38.x or a subsequent one.
    • We will wait 2 release. So UpdateAddresses() will be removed in v1.39.x

While these changes are not strictly following semantic versioning or the Go compatibility promise, they are in accordance with our versioning policy as the changes are limited to experimental APIs.

Metadata

Metadata

Assignees

Labels

P3Type: API ChangeBreaking API changes (experimental APIs only!)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions