Cherry pick #8864 to v1.79.x#8896
Merged
eshitachandwani merged 1 commit intogrpc:v1.79.xfrom Feb 11, 2026
Merged
Conversation
This PR implements the currently in-review gRFC A113: grpc/proposal#535. I've split the PR into logically separate commits to help with the review process. Summary of changes: - Commit 1: simplify the implementation of `groupLocalitiesByPriority` - Change the implementation to use newly added methods in the stdlib `maps` and `slices` package to significantly simplify the implementation (and get rid of an unnecessary test) - Commit 2: Remove code that handles localities and endpoints of weight 0 - Remove unnecessary checks for locality and endpoint weights of `0` in `cluster_resolver`. The xDS client already guarantees that these weights will never be set to `0`. - Commit 3: add the env var GRPC_EXPERIMENTAL_PF_WEIGHTED_SHUFFLING - Commit 4: Weight computation changes in cluster_resolver LB policy - This performs the weight normalization and fixed-point arithmetic specified in A113 - The change here is guarded by the above env var - Ended up duplicating the tests that verify the weight computation behavior. This will make it easier to delete the old tests when the env var is removed. - Commit 5: Fix a broken test in ring_hash due to the new weight computation - Commit 6: Weighted shuffling in pick_first - Contains the changes specified in A113 for the pick_first LB policy - Changes are guarded by the env var RELEASE NOTES: - pickfirst: Add support for weighted random shuffling of endpoints, as described in gRFC A113
Pranjali-2501
approved these changes
Feb 11, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v1.79.x #8896 +/- ##
===========================================
- Coverage 83.48% 83.33% -0.15%
===========================================
Files 414 414
Lines 32720 32743 +23
===========================================
- Hits 27315 27287 -28
- Misses 4025 4058 +33
- Partials 1380 1398 +18
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original PR : #8864
RELEASE NOTES: