upstream: Fallback policy per selector support (#7087)

This code change allows to redefine fallback policy per specific subset selector. Because of how existing LbSubsetMap trie data structure is organised (mapping subset key to values), is not possible to do lookups for fallback policy only based on subset keys (had to introduce additional trie that maps subset keys to keys and has fallback policy on leaf level). Additional LbSubsetSelectorFallbackPolicy enum required to correctly identify the case when fallback policy is not set for given selector (otherwise it would always default to NO_FALLBACK, breaking backwards compatibility, if field is not set we should use top level fallback policy instead).

Risk Level: Medium
Testing: Done
Docs Changes: Updated related docs
Release Notes: added
Fixes #5130

Signed-off-by: Kateryna Nezdolii <nezdolik@spotify.com>

Mirrored from https://github.com/envoyproxy/envoy @ 1a60b343665cf2ffb966f37bbe48fed21805df57
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent 168fa5d1ae
commit f7cfd4b8a4
  1. 18
      envoy/api/v2/cds.proto

@ -367,6 +367,24 @@ message Cluster {
message LbSubsetSelector {
// List of keys to match with the weighted cluster metadata.
repeated string keys = 1;
// The behavior used when no endpoint subset matches the selected route's
// metadata.
LbSubsetSelectorFallbackPolicy fallback_policy = 2
[(validate.rules).enum.defined_only = true];
// Allows to override top level fallback policy per selector.
enum LbSubsetSelectorFallbackPolicy {
// If NOT_DEFINED top level config fallback policy is used instead.
NOT_DEFINED = 0;
// If NO_FALLBACK is selected, a result equivalent to no healthy hosts is reported.
NO_FALLBACK = 1;
// If ANY_ENDPOINT is selected, any cluster endpoint may be returned
// (subject to policy, health checks, etc).
ANY_ENDPOINT = 2;
// If DEFAULT_SUBSET is selected, load balancing is performed over the
// endpoints matching the values from the default_subset field.
DEFAULT_SUBSET = 3;
}
}
// For each entry, LbEndpoint.Metadata's

Loading…
Cancel
Save