Request hash on filterstate (#10263)

Add a new hash method based on Hashable object in FilterState.

Risk Level: LOW (new method)
Testing: unit tests
Docs Changes: N/A
Release Notes: N/A
Fixes #9701

Signed-off-by: Xin Zhuang <stevenzzz@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ cfa91de1a284a8be848cfbd5844a89157baf64d2
master-ci-test
data-plane-api(CircleCI) 5 years ago
parent a896d18c8f
commit 7c1da45f2d
  1. 12
      envoy/api/v2/route/route_components.proto
  2. 15
      envoy/config/route/v3/route_components.proto

@ -597,7 +597,7 @@ message RouteAction {
// Specifies the route's hashing policy if the upstream cluster uses a hashing :ref:`load balancer // Specifies the route's hashing policy if the upstream cluster uses a hashing :ref:`load balancer
// <arch_overview_load_balancing_types>`. // <arch_overview_load_balancing_types>`.
// [#next-free-field: 6] // [#next-free-field: 7]
message HashPolicy { message HashPolicy {
message Header { message Header {
// The name of the request header that will be used to obtain the hash // The name of the request header that will be used to obtain the hash
@ -648,6 +648,13 @@ message RouteAction {
string name = 1 [(validate.rules).string = {min_bytes: 1}]; string name = 1 [(validate.rules).string = {min_bytes: 1}];
} }
message FilterState {
// The name of the Object in the per-request filterState, which is an
// Envoy::Http::Hashable object. If there is no data associated with the key,
// or the stored object is not Envoy::Http::Hashable, no hash will be produced.
string key = 1 [(validate.rules).string = {min_bytes: 1}];
}
oneof policy_specifier { oneof policy_specifier {
option (validate.required) = true; option (validate.required) = true;
@ -662,6 +669,9 @@ message RouteAction {
// Query parameter hash policy. // Query parameter hash policy.
QueryParameter query_parameter = 5; QueryParameter query_parameter = 5;
// Filter state hash policy.
FilterState filter_state = 6;
} }
// The flag that short-circuits the hash computing. This field provides a // The flag that short-circuits the hash computing. This field provides a

@ -550,7 +550,7 @@ message RouteAction {
// Specifies the route's hashing policy if the upstream cluster uses a hashing :ref:`load balancer // Specifies the route's hashing policy if the upstream cluster uses a hashing :ref:`load balancer
// <arch_overview_load_balancing_types>`. // <arch_overview_load_balancing_types>`.
// [#next-free-field: 6] // [#next-free-field: 7]
message HashPolicy { message HashPolicy {
option (udpa.annotations.versioning).previous_message_type = option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.route.RouteAction.HashPolicy"; "envoy.api.v2.route.RouteAction.HashPolicy";
@ -616,6 +616,16 @@ message RouteAction {
string name = 1 [(validate.rules).string = {min_bytes: 1}]; string name = 1 [(validate.rules).string = {min_bytes: 1}];
} }
message FilterState {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.route.RouteAction.HashPolicy.FilterState";
// The name of the Object in the per-request filterState, which is an
// Envoy::Http::Hashable object. If there is no data associated with the key,
// or the stored object is not Envoy::Http::Hashable, no hash will be produced.
string key = 1 [(validate.rules).string = {min_bytes: 1}];
}
oneof policy_specifier { oneof policy_specifier {
option (validate.required) = true; option (validate.required) = true;
@ -630,6 +640,9 @@ message RouteAction {
// Query parameter hash policy. // Query parameter hash policy.
QueryParameter query_parameter = 5; QueryParameter query_parameter = 5;
// Filter state hash policy.
FilterState filter_state = 6;
} }
// The flag that short-circuits the hash computing. This field provides a // The flag that short-circuits the hash computing. This field provides a

Loading…
Cancel
Save