Skip to content

orca: add out-of-band reporting for client-side WRR - #44403

Merged
botengyao merged 16 commits into
envoyproxy:mainfrom
jukie:orca-oob-client-library
May 19, 2026
Merged

orca: add out-of-band reporting for client-side WRR#44403
botengyao merged 16 commits into
envoyproxy:mainfrom
jukie:orca-oob-client-library

Conversation

@jukie

@jukie jukie commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Commit Message: orca: add out-of-band reporting for client-side WRR

Additional Description: Adds ORCA out-of-band load reporting support for client_side_weighted_round_robin. When enable_oob_load_report is true, Envoy opens a per-host HTTP/2 gRPC stream to xds.service.orca.v3.OpenRcaService/StreamCoreMetrics, decodes server-streamed OrcaLoadReports, and feeds them into the existing ORCA weight manager used by in-band reports. This also adds a dedicated host connection path for ORCA reporting, including LogicalHost address snapshotting, and cluster-scoped lb_orca_oob.* stats for reporting/session state.

Risk Level: Low
Testing: Added unit and integration coverage for:

  • ORCA OOB manager lifecycle, report decoding, transient failures, GOAWAY handling, and terminal UNIMPLEMENTED
  • host/logical-host ORCA reporting connection behavior
  • CSWRR OOB config defaults/overrides
  • basic OOB integration stats/report flow

Docs Changes: N/A
Release Notes: Added changelog entry for client_side_weighted_round_robin ORCA out-of-band reporting
Platform Specific Features: N/A
xRef #44318
xRef #44329

AI Disclosure: AI was used during implementation

@repokitteh-read-only

Copy link
Copy Markdown

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: #44403 was opened by jukie.

see: more, trace.

@jukie
jukie force-pushed the orca-oob-client-library branch from d940d58 to 5f1690d Compare April 12, 2026 18:03
@jukie

jukie commented Apr 12, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@jukie
jukie marked this pull request as ready for review April 13, 2026 22:39
@adisuissa

Copy link
Copy Markdown
Contributor

Thanks for starting the work on this
I looked at #44318 but I'm not sure I understand the design. Specifically what are the requirements (e.g., how many OOB servers will be supported, how is an ORCA report shared between multiple servers on a different cadence), and what is the relationship between the different components.
Is there some doc that describes how the OOB feature of https://github.com/grpc/proposal/blob/master/A51-custom-backend-metrics.md will be incorporated into Envoy?

/assign @efimki

@efimki

efimki commented Apr 14, 2026

Copy link
Copy Markdown
Member

Tagging @markdroth to comment from gRPC perspective.

Reading https://github.com/grpc/proposal/blob/master/A51-custom-backend-metrics.md#out-of-band-reporting-1 it seems like in gRPC case server is pushing OOB load reports to connected clients.

@jukie

jukie commented Apr 14, 2026

Copy link
Copy Markdown
Contributor Author

From https://grpc.io/docs/guides/custom-backend-metrics/:
image

We're still matching the model where an upstream server pushes reports to connected clients (Envoy here) but a client needs to initiate the connection and communicate report_interval.

Comment thread source/common/orca/orca_oob_client.cc Outdated
@jukie
jukie requested a review from paul-r-gall April 15, 2026 01:08
@mathetake

Copy link
Copy Markdown
Member

kindly ping @efimki @adisuissa

@jukie

jukie commented Apr 20, 2026

Copy link
Copy Markdown
Contributor Author

I'll rework this and discuss the design a bit more in the issue

@jukie

jukie commented Apr 26, 2026

Copy link
Copy Markdown
Contributor Author

Reworked the implementation here based on feedback

@jukie jukie changed the title orca: add out of band reporting client library orca: add out-of-band reporting for client-side WRR Apr 26, 2026
@jukie

jukie commented Apr 26, 2026

Copy link
Copy Markdown
Contributor Author

/coverage

@repokitteh-read-only

Copy link
Copy Markdown

Coverage for this Pull Request will be rendered here:

https://storage.googleapis.com/envoy-cncf-pr/44403/coverage/index.html

For comparison, current coverage on main branch is here:

https://storage.googleapis.com/envoy-cncf-postsubmit/main/coverage/index.html

The coverage results are (re-)rendered each time the CI Envoy/Checks (coverage) job completes.

🐱

Caused by: a #44403 (comment) was created by @jukie.

see: more, trace.

@jukie

jukie commented Apr 26, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@jukie

jukie commented Apr 26, 2026

Copy link
Copy Markdown
Contributor Author

Summary of the updated implementation:
OOB load reporting is wired into CSWRR as a separate OrcaOobManager alongside the existing OrcaWeightManager, modeled on GrpcHealthCheckerImpl. Both managers share OrcaLoadReportHandler, so OOB reports feed the same OrcaHostLbPolicyData atomics as the in-band path.

  • A new pure virtual Host::createOrcaReportingConnection (parallel to createHealthCheckConnection) is the seam for per-host codec clients; LogicalHost overrides for lock-snapshot semantics. The metadata + transport_socket_options parameters reserve room for a future per-host OobConfig override.
  • CSWRR wires enable_oob_load_report + oob_reporting_period. Manager is constructed only when enabled (default false → null member, zero overhead).
  • All OOB activity runs on the cluster's main-thread dispatcher; one stream per host. Sessions follow HC patterns for reset/GOAWAY/teardown; jittered exponential backoff with initial-attempt stagger; 3× reporting-period inactivity watchdog; Unimplemented is terminal.
  • Stats are cluster-scoped under lb_orca_oob - reports_received, report_errors, stream_failures, stream_terminated, active_sessions

@jukie

jukie commented Apr 27, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@jukie

jukie commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

Hey @paul-r-gall could you take another look at this?

Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
paul-r-gall
paul-r-gall previously approved these changes May 1, 2026
Comment thread source/common/upstream/upstream_impl.cc Outdated
@paul-r-gall

Copy link
Copy Markdown
Contributor

Requesting review from @yanavlasov or @botengyao for senior maintainer.

@paul-r-gall

Copy link
Copy Markdown
Contributor

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request implements out-of-band (OOB) ORCA load reporting for the client_side_weighted_round_robin load balancing policy, introducing an OrcaOobManager to handle per-host gRPC streams. The implementation includes new connection creation logic in the Host interface and LogicalHost. Feedback points out that the authority() method's fallback to a string representation for certain address types, such as Unix Domain Sockets, could potentially lead to invalid characters in the HTTP :authority header.

Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
…ing for non-IP hosts

Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
@jukie

jukie commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@jukie
jukie requested a review from paul-r-gall May 7, 2026 05:13

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request implements out-of-band (OOB) ORCA load reporting for the client-side weighted round-robin load balancing policy using server-streaming gRPC. It introduces the OrcaOobManager to manage per-host gRPC sessions and updates upstream host abstractions to support dedicated reporting connections. The review feedback highlights an issue with the :authority header formatting for IPv6 addresses, suggesting the use of asString() to ensure compliance with RFC 3986 by including brackets and the port number.

…ger.cc

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Isaac Wilson <isaac.wilson514@gmail.com>
paul-r-gall
paul-r-gall previously approved these changes May 13, 2026
@paul-r-gall

Copy link
Copy Markdown
Contributor

/assign @botengyao

@botengyao botengyao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

sorry for the delay, and lgtm module one q.


void OrcaOobManager::OobSession::decodeData(Buffer::Instance& data, bool end_stream) {
std::vector<Grpc::Frame> frames;
if (!decoder_.decode(data, frames).ok()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Consider setting a max gRPC frame/message size? ORCA reports should be small, but this currently lets every upstream OOB stream buffer arbitrarily large frames, can be a follow-up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a 64Ki limit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@botengyao updated. Please let me know if you have a different value in mind but I think 64KiB should be high enough. We can make this configurable once the per-host/cluster config surface is added for overrides.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

sgtm, thanks for adding this.

Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
jukie added 2 commits May 17, 2026 23:48
Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
@jukie
jukie requested review from botengyao and paul-r-gall May 18, 2026 13:42

@botengyao botengyao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm, thanks!

@botengyao
botengyao merged commit ae96a25 into envoyproxy:main May 19, 2026
29 checks passed
@jukie
jukie deleted the orca-oob-client-library branch May 19, 2026 14:11
alrzazz pushed a commit to alrzazz/envoy that referenced this pull request May 20, 2026
Commit Message: orca: add out-of-band reporting for client-side WRR

Additional Description: Adds ORCA out-of-band load reporting support for
`client_side_weighted_round_robin`. When `enable_oob_load_report` is
true, Envoy opens a per-host HTTP/2 gRPC stream to
`xds.service.orca.v3.OpenRcaService/StreamCoreMetrics`, decodes
server-streamed `OrcaLoadReport`s, and feeds them into the existing ORCA
weight manager used by in-band reports. This also adds a dedicated host
connection path for ORCA reporting, including LogicalHost address
snapshotting, and cluster-scoped `lb_orca_oob.*` stats for
reporting/session state.

Risk Level: Low
Testing: Added unit and integration coverage for:
- ORCA OOB manager lifecycle, report decoding, transient failures,
GOAWAY handling, and terminal `UNIMPLEMENTED`
- host/logical-host ORCA reporting connection behavior
- CSWRR OOB config defaults/overrides
- basic OOB integration stats/report flow

Docs Changes: N/A
Release Notes: Added changelog entry for
`client_side_weighted_round_robin` ORCA out-of-band reporting
Platform Specific Features: N/A
xRef envoyproxy#44318
xRef envoyproxy#44329

AI Disclosure: AI was used during implementation

---------

Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
Signed-off-by: Isaac Wilson <isaac.wilson514@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Alireza <alrzazz98@gmail.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.

6 participants