Skip to content
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/internal/balancer/clusterimpl: Switch cluster impl child to graceful switch #6420

Merged

Conversation

zasweq
Copy link
Contributor

@zasweq zasweq commented Jun 27, 2023

Fixes #6170. Cluster Impl was implemented before there was a graceful switch balancer object, and thus did not have it's child as a Graceful Switch. The child of cluster impl can be dynamic over the lifetime of the xDS tree based off locality + endpoint picking configuration for a priority, so this is a fairly common use case that will be better served with graceful switch functionality present.

RELEASE NOTES: N/A

@zasweq zasweq requested a review from easwars June 27, 2023 23:36
@zasweq zasweq added the Type: Internal Cleanup Refactors, etc label Jun 27, 2023
@zasweq zasweq added this to the 1.57 Release milestone Jun 27, 2023
if b.childLB != nil {
b.childLB.Close()
if err := b.child.SwitchTo(bb); err != nil {
return fmt.Errorf("cluster impl: error switching to child of type %q: %v", newConfig.ChildPolicy.Name, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: The existing error strings don't have a prefix of cluster impl. My preference would be to stay consistent with existing code or switch them all. And even if you switch, I would think the prefix would be clusterimpl and not cluster impl.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped the prefix.

@easwars easwars assigned zasweq and unassigned easwars Jun 30, 2023
@zasweq zasweq merged commit 620a118 into grpc:master Jun 30, 2023
1 check passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xds/internal/balancer/clusterimpl: Switch Child LB to Graceful Switch
2 participants