Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to attach dynamic data to Host object #34529

Closed
efimki opened this issue Jun 4, 2024 · 4 comments · Fixed by #34943
Closed

Provide a way to attach dynamic data to Host object #34529

efimki opened this issue Jun 4, 2024 · 4 comments · Fixed by #34943
Labels
area/load balancing enhancement Feature requests. Not bugs or questions.

Comments

@efimki
Copy link
Contributor

efimki commented Jun 4, 2024

Title: Provide a way to attach dynamic data to Host object

Description:
I'm prototyping a new LB policy that will calculate host weights for WRR locally, based on custom headers attached to the backend responses.

The LB policy needs to keep dynamic internal data on per host basis, similar to HostDescription::metadata()

I think FilterState serves similar purpose, but it doesn't attach to a Host.

Are there better alternatives, or would it be possible to attach dynamic data (similar to FilterState) to a Host or HostDescription?

@efimki efimki added enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Jun 4, 2024
@tonya11en
Copy link
Member

Are you trying to do something where the upstream hosts report their load via response headers and scale weights based on this? If so, it's the same as the ongoing conversation in #20907.

Otherwise, if you're implementing a custom LB extension are you not able to modify the Host objects in the implementation or keep some mapping of host->derived weight?

@efimki
Copy link
Contributor Author

efimki commented Jun 4, 2024

Yes, I'm trying to implement a ClientSideWeightedRoundRobin LB Policy that would use LoadMetricStats collected by an upstream filter that extracts them from response headers in the format of OrcaLoadReport.

@efimki
Copy link
Contributor Author

efimki commented Jun 4, 2024

Are you suggesting to extend Host object specifically in custom LB extension or something else?
Keeping some mapping of host->derived is certainly an option, but seems a bit clunky.

@adisuissa adisuissa added area/load balancing and removed triage Issue requires triage labels Jun 5, 2024
@adisuissa
Copy link
Contributor

cc @wbpcode who may be interested in this new LB policy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/load balancing enhancement Feature requests. Not bugs or questions.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants