Skip to content

upstream: optimize LRS locality stats allocation - #46449

Open
birenroy wants to merge 1 commit into
envoyproxy:mainfrom
birenroy:lrs-arena
Open

upstream: optimize LRS locality stats allocation#46449
birenroy wants to merge 1 commit into
envoyproxy:mainfrom
birenroy:lrs-arena

Conversation

@birenroy

@birenroy birenroy commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Avoids stack allocation and copy of UpstreamLocalityStats in LRS by constructing the message directly on the cluster stats message.

This change was created with the help of the Gemini AI model. I have read and understand the code.

Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:

Avoid stack allocation and copy of UpstreamLocalityStats in LRS
by constructing it directly on the cluster stats message.

TAG=agy
CONV=24f630d4-0ff9-4691-8e6e-d12bb8fa3e82

Signed-off-by: Biren Roy <birenroy@google.com>
@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: #46449 was opened by birenroy.

see: more, trace.

@birenroy
birenroy marked this pull request as ready for review July 30, 2026 19:30
@birenroy

Copy link
Copy Markdown
Contributor Author

/assign @adisuissa

@adisuissa adisuissa 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.

LGTM, thanks!
/assign-from @envoyproxy/senior-maintainers

envoy::config::endpoint::v3::UpstreamLocalityStats locality_stats;
locality_stats.mutable_locality()->MergeFrom(hosts[0]->locality());
locality_stats.set_priority(host_set->priority());
auto* locality_stats = cluster_stats->add_upstream_locality_stats();

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.

Please add a comment here describing that this may be removed later if no local stats will need to be sent.

@repokitteh-read-only

Copy link
Copy Markdown

@envoyproxy/senior-maintainers assignee is @yanavlasov

🐱

Caused by: a #46449 (review) was submitted by @adisuissa.

see: more, trace.

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.

3 participants