You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*: Implementation of weighted random shuffling (A113) (#8864)
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
0 commit comments