support multiple HostLbPolicyData entries per host#43995
support multiple HostLbPolicyData entries per host#43995jukie wants to merge 3 commits intoenvoyproxy:mainfrom
Conversation
Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com>
wbpcode
left a comment
There was a problem hiding this comment.
LGTM. Thanks for this great contribution. And defer this to @paul-r-gall for another check. :)
envoy/upstream/host_description.h
Outdated
| /** | ||
| * @return true if this host data wants router ORCA callbacks. | ||
| */ | ||
| virtual bool receivesOrcaLoadReport() const { return false; } |
There was a problem hiding this comment.
@adisuissa lmk what you think about this API. I think it solves the problem, but I still with that "orca math" were not even part of the router filter at all.
There was a problem hiding this comment.
Actually, the default return value here is harmful; imagine if someone had their own implementation of this thing that relied on orca reports. Rather than ceasing to compile, their implementation would start to misbehave. In particular, I recommend that you either make this a pure method or have the default value be true.
There was a problem hiding this comment.
I still think the bigger problem is that instead of having the 'HostLbPolicyData' in the host it should be part of the LB-policy implementation. But modifying that is probably a big change.
So the question is whether the suggested solution causes some strange side-effects or greatly complicates its maintenance. I don't have sufficient context to answer this at the moment.
There was a problem hiding this comment.
I'd be willing to work on moving HostLbPolicyData out from host-level but it does seem like a non-trivial change. Would it be reasonable to take that on in a follow-up and use this as the first step?
Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com>
Based on feedback in #43784.
This converts HostLbPolicyData from single-slot to a vector so multiple LB policies (e.g. the new policy in #43784 plus CSWRR as a child) can each attach per-host state and receive ORCA reports independently.