Skip to content

Extract ORCA logic from CSWRR into reusable library#43695

Open
jukie wants to merge 3 commits intoenvoyproxy:mainfrom
jukie:orca-weightmanager-lib
Open

Extract ORCA logic from CSWRR into reusable library#43695
jukie wants to merge 3 commits intoenvoyproxy:mainfrom
jukie:orca-weightmanager-lib

Conversation

@jukie
Copy link
Contributor

@jukie jukie commented Feb 28, 2026

This is related to #43665 and is part 1 to enable adding new ORCA-based LB policies without duplicating CSWRR internals.

Extracts ORCA weight management logic from ClientSideWeightedRoundRobinLoadBalancer into a reusable OrcaWeightManager class. This is a refactor with no behavior change and all existing CSWRR tests pass.

  • OrcaWeightManagerConfig — config struct for timing params, metric names, and error penalty
  • OrcaLoadReportHandler — computes host weight from ORCA load reports
  • OrcaHostLbPolicyData — per-host LB data (weight + timestamps), renamed from ClientSideHostLbPolicyData
  • OrcaWeightManager — orchestrates periodic weight updates via timer and priority-set callbacks

AI disclosure: AI agents were used during implementation and for writing tests but I fully understand the changes here

Commit Message: Extract OrcaWeightManager from ClientSideWeightedRoundRobinLoadBalancer into reusable common library
Additional Description: Extracts ORCA internals from CSWRR to allow for more ORCA-based LB policies without duplication
Risk Level: Low, clean extraction without any behavior changes
Testing: New test suite added, all existing CSWRR tests pass unchanged, and WrrLocality tests pass
Docs Changes: No user-facing changes or docs update needed
Release Notes: None
Platform Specific Features: N/A
xRef: #43665

…er into reusable common library

Signed-off-by: jukie <isaac.wilson514@gmail.com>
@repokitteh-read-only
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #43695 was opened by jukie.

see: more, trace.

@jukie jukie changed the title Extract OrcaWeightManager from ClientSideWeightedRoundRobinLoadBalanc… Extract ORCA logic from CSWRR into reusable class Feb 28, 2026
Signed-off-by: jukie <isaac.wilson514@gmail.com>
@jukie jukie changed the title Extract ORCA logic from CSWRR into reusable class Extract ORCA logic from CSWRR into reusable library Feb 28, 2026
Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants