Skip to content

balancer/randomsubsetting: Implementation of the random_subsetting LB policy#8650

Merged
easwars merged 14 commits intogrpc:masterfrom
marek-szews:random-subsetting-lb-policy
Dec 12, 2025
Merged

balancer/randomsubsetting: Implementation of the random_subsetting LB policy#8650
easwars merged 14 commits intogrpc:masterfrom
marek-szews:random-subsetting-lb-policy

Conversation

@marek-szews
Copy link
Copy Markdown
Contributor

@marek-szews marek-szews commented Oct 14, 2025

Implements gRFC A68.

Note that this PR only implements the LB policy and does not implement the xDS integration specified here: https://github.com/grpc/proposal/blob/master/A68-random-subsetting.md#xds-integration

RELEASE NOTES:

  • balancer/randomsubsetting: Implementation of the random_subsetting LB policy

Signed-off-by: marek-szews <szews@google.com>
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Oct 14, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@easwars easwars self-assigned this Oct 15, 2025
@easwars easwars self-requested a review October 15, 2025 19:17
@easwars easwars added Type: Feature New features or improvements in behavior Area: xDS Includes everything xDS related, including LB policies used with xDS. Area: Resolvers/Balancers Includes LB policy & NR APIs, resolver/balancer/picker wrappers, LB policy impls and utilities. and removed Area: xDS Includes everything xDS related, including LB policies used with xDS. labels Oct 15, 2025
@easwars
Copy link
Copy Markdown
Contributor

easwars commented Oct 15, 2025

@marek-szews : Could you please get the tests to pass. Thanks.

Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go
@github-actions
Copy link
Copy Markdown

This PR is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed.

@github-actions github-actions Bot added stale and removed stale labels Oct 23, 2025
@dfawley
Copy link
Copy Markdown
Member

dfawley commented Oct 29, 2025

Hi @marek-szews - I think we're waiting on you to make some updates so we can continue the review. We can discuss Friday but I wanted to ping this in part to prevent the stale bot from closing it.

@arjan-bal arjan-bal added this to the 1.78 Release milestone Oct 30, 2025
Copy link
Copy Markdown
Contributor Author

@marek-szews marek-szews left a comment

Choose a reason for hiding this comment

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

Rework done, tests passed

Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
@dfawley dfawley assigned easwars and unassigned marek-szews Oct 31, 2025
@easwars easwars changed the title Implementation of A68 random_subsetting LB policy. balancer/randomsubsetting: Implementation of the LB policy Nov 13, 2025
@easwars easwars changed the title balancer/randomsubsetting: Implementation of the LB policy balancer/randomsubsetting: Implementation of the random_subsetting LB policy Nov 13, 2025
@easwars
Copy link
Copy Markdown
Contributor

easwars commented Nov 13, 2025

Rework done, tests passed

Tests are still failing. Please read this document for guidelines: https://github.com/grpc/grpc-go/blob/master/CONTRIBUTING.md

TL;dr

All tests need to be passing before your change can be merged. We recommend you run tests locally before creating your PR to catch breakages early on:

./scripts/vet.sh to catch vet errors.
go test -cpu 1,4 -timeout 7m ./... to run the tests.
go test -race -cpu 1,4 -timeout 7m ./... to run tests in race mode

@easwars easwars assigned marek-szews and unassigned easwars Nov 13, 2025
@easwars easwars assigned arjan-bal and unassigned easwars Dec 11, 2025
// To install the LB policy, import this package as:
//
// import _ "google.golang.org/grpc/balancer/randomsubsetting"
package randomsubsetting
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@easwars should we mark this package as experimental?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Done. Also, changed the name of the LB policy to include the experimental suffix.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The name of the LB policy may need to be consistent across languages since the LB config may come through the the resolver (DNS TXT records). We may need to update the gRFC to add the experimental suffix.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes. Sent grpc/proposal#527 for the same.

Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
Comment thread balancer/randomsubsetting/randomsubsetting.go Outdated
@arjan-bal arjan-bal assigned easwars and marek-szews and unassigned arjan-bal Dec 12, 2025
Copy link
Copy Markdown
Contributor

@arjan-bal arjan-bal left a comment

Choose a reason for hiding this comment

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

LGTM, module a nit about the _experimental suffix in the LB policy name that should be removed based on the gRFC.

@easwars
Copy link
Copy Markdown
Contributor

easwars commented Dec 12, 2025

LGTM, module a nit about the _experimental suffix in the LB policy name that should be removed based on the gRFC.

Chatted with Mark who agreed that the _experimental suffix should have been in there. I also have a PR out to change the gRFC: grpc/proposal#527

@easwars easwars merged commit 9fd5d8a into grpc:master Dec 12, 2025
13 of 14 checks passed
This was referenced Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Resolvers/Balancers Includes LB policy & NR APIs, resolver/balancer/picker wrappers, LB policy impls and utilities. Type: Feature New features or improvements in behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants