async client: add hash_policy option#8206
Conversation
Signed-off-by: Kuat Yessenov <kuat@google.com>
|
We are also interested in providing a default hash policy for the internal client that is based off proxy node metadata. That should provide session affinity to the external system back-end with consistent hash load balancing. |
|
Friendly ping. |
|
Ping? |
|
Whoops sorry, this one fell through the cracks last week. I'll review by tomorrow. |
junr03
left a comment
There was a problem hiding this comment.
One small comment. Otherwise, lgtm. Thanks for this change!
| return *this; | ||
| } | ||
| RequestOptions& setHashPolicy( | ||
| const Protobuf::RepeatedPtrField<envoy::api::v2::route::RouteAction::HashPolicy>& v) { |
There was a problem hiding this comment.
this can be StreamOptions::setHashPolicy(v); like above, right?
There was a problem hiding this comment.
I think it needs to downcast to request options, so requires an override in a subclass. It's a config options class AFAICT.
include/envoy/http/async_client.h
Outdated
| } | ||
| RequestOptions& setHashPolicy( | ||
| const Protobuf::RepeatedPtrField<envoy::api::v2::route::RouteAction::HashPolicy>& v) { | ||
| hash_policy = v; |
There was a problem hiding this comment.
| hash_policy = v; | |
| StreamOptions::setHashPolicy(v); |
Sorry about the confusion above. I meant to tag this line.
There was a problem hiding this comment.
Ah, got it. Yes, updated, thanks.
|
The failing test looks like a random chance (birthday paradox?) |
|
/retest |
|
🤷♀️ nothing to rebuild. |
|
/retest |
|
🔨 rebuilding |
|
This is finally de-flaked! |
|
LGTM, can you merge master to pick latest CI change? |
|
@lizan Ping? |
|
@kyessenov can you merge master? |
|
@lizan Done master merge. |
Description: Add hash policy to the async client. This is needed to support consistent hash load balancing for external requests originating from the proxy (e.g. telemetry, ext authz, WASM, etc). PR moves hash policy implementation to http namespace with no functional changes. Risk Level: low Testing: unit test Docs Changes: none Release Notes: none Fixes envoyproxy#4899 Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov kuat@google.com
Description:
Add hash policy to the async client. This is needed to support consistent hash load balancing for external requests originating from the proxy (e.g. telemetry, ext authz, WASM, etc).
PR moves hash policy implementation to http namespace with no functional changes.
/cc @mandarjog
Risk Level: low
Testing: unit test
Docs Changes: none
Release Notes: none
Fixes #4899