Skip to content

Cherry-pick #8997 to v1.80.x#9027

Merged
arjan-bal merged 1 commit intogrpc:v1.80.xfrom
easwars:v1.80.x
Mar 31, 2026
Merged

Cherry-pick #8997 to v1.80.x#9027
arjan-bal merged 1 commit intogrpc:v1.80.xfrom
easwars:v1.80.x

Conversation

@easwars
Copy link
Copy Markdown
Contributor

@easwars easwars commented Mar 30, 2026

Original PR: #8997

RELEASE NOTES:

  • xds/priority: Stop caching child LB policies removed from the configuration. This will help reduce memory and cpu usage when localities are constantly switching between priorities.

…grpc#8997)

Summary of changes:
- Add a new API to the `balancergroup` that allows removal of child
policies with immediate effect, even when a cache is configured.
- Make the `priority` LB use this new API when removing child policies
that have been removed from its configuration.
- This change is protected with an environment variable that turns on
the new behavior by default.
- Update the name generation algorithm to give higher preference to
reuse names of existing priority (if there is a locality match) over
lower priorities.
- Fix a bunch of tests in the `priority` LB policy to ensure that they
work with the *old* and *new* behavior.
- Fix a couple of aggregate cluster tests such that they don't
continuously handle the same NACKed resource from the management server.
- Other minor cleanups in tests that I had to look at as part of making
this change.

RELEASE NOTES:
* xds/priority: Stop caching child LB policies removed from the
configuration. This will help reduce memory and cpu usage when
localities are constantly switching between priorities.
@easwars easwars requested a review from dfawley March 30, 2026 21:01
@easwars easwars added the Type: Behavior Change Behavior changes not categorized as bugs label Mar 30, 2026
@easwars easwars added this to the 1.80 Release milestone Mar 30, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 78.94737% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.16%. Comparing base (e45ed24) to head (15ef957).
⚠️ Report is 1 commits behind head on v1.80.x.

Files with missing lines Patch % Lines
internal/balancergroup/balancergroup.go 68.18% 1 Missing and 6 partials ⚠️
...ds/balancer/cdsbalancer/configbuilder_childname.go 88.00% 0 Missing and 3 partials ⚠️
internal/envconfig/envconfig.go 0.00% 1 Missing ⚠️
internal/xds/balancer/priority/balancer_child.go 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           v1.80.x    #9027      +/-   ##
===========================================
- Coverage    82.45%   82.16%   -0.29%     
===========================================
  Files          410      410              
  Lines        32601    32628      +27     
===========================================
- Hits         26880    26809      -71     
- Misses        4051     4080      +29     
- Partials      1670     1739      +69     
Files with missing lines Coverage Δ
internal/xds/balancer/priority/balancer.go 62.93% <100.00%> (-21.56%) ⬇️
...nternal/xds/balancer/priority/balancer_priority.go 73.33% <100.00%> (ø)
internal/envconfig/envconfig.go 78.57% <0.00%> (-21.43%) ⬇️
internal/xds/balancer/priority/balancer_child.go 79.71% <80.00%> (-11.06%) ⬇️
...ds/balancer/cdsbalancer/configbuilder_childname.go 80.55% <88.00%> (-19.45%) ⬇️
internal/balancergroup/balancergroup.go 75.81% <68.18%> (-10.66%) ⬇️

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@arjan-bal
Copy link
Copy Markdown
Contributor

The title and description seem to mention the wrong PR. I'll try to fix them before approving the changes.

@arjan-bal arjan-bal changed the title Cherry-pick #8987 to v1.80.x Cherry-pick #8997 to v1.80.x Mar 31, 2026
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

@arjan-bal arjan-bal merged commit 64ebf0a into grpc:v1.80.x Mar 31, 2026
24 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Behavior Change Behavior changes not categorized as bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants