envoy_types/generated/envoy.extensions.retry.priority.previous_priorities.v3.rs
1// This file is @generated by prost-build.
2/// A retry host selector that attempts to spread retries between priorities, even if certain
3/// priorities would not normally be attempted due to higher priorities being available.
4///
5/// As priorities get excluded, load will be distributed amongst the remaining healthy priorities
6/// based on the relative health of the priorities, matching how load is distributed during regular
7/// host selection. For example, given priority healths of {100, 50, 50}, the original load will be
8/// {100, 0, 0} (since P0 has capacity to handle 100% of the traffic). If P0 is excluded, the load
9/// changes to {0, 50, 50}, because P1 is only able to handle 50% of the traffic, causing the
10/// remaining to spill over to P2.
11///
12/// Each priority attempted will be excluded until there are no healthy priorities left, at which
13/// point the list of attempted priorities will be reset, essentially starting from the beginning.
14/// For example, given three priorities P0, P1, P2 with healthy % of 100, 0 and 50 respectively, the
15/// following sequence of priorities would be selected (assuming update_frequency = 1):
16/// Attempt 1: P0 (P0 is 100% healthy)
17/// Attempt 2: P2 (P0 already attempted, P2 only healthy priority)
18/// Attempt 3: P0 (no healthy priorities, reset)
19/// Attempt 4: P2
20///
21/// In the case of all upstream hosts being unhealthy, no adjustments will be made to the original
22/// priority load, so behavior should be identical to not using this plugin.
23///
24/// Using this PriorityFilter requires rebuilding the priority load, which runs in O(# of
25/// priorities), which might incur significant overhead for clusters with many priorities.
26/// \[\#extension: envoy.retry_priorities.previous_priorities\]
27#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
28pub struct PreviousPrioritiesConfig {
29 /// How often the priority load should be updated based on previously attempted priorities. Useful
30 /// to allow each priorities to receive more than one request before being excluded or to reduce
31 /// the number of times that the priority load has to be recomputed.
32 ///
33 /// For example, by setting this to 2, then the first two attempts (initial attempt and first
34 /// retry) will use the unmodified priority load. The third and fourth attempt will use priority
35 /// load which excludes the priorities routed to with the first two attempts, and the fifth and
36 /// sixth attempt will use the priority load excluding the priorities used for the first four
37 /// attempts.
38 ///
39 /// Must be greater than 0.
40 #[prost(int32, tag = "1")]
41 pub update_frequency: i32,
42}
43impl ::prost::Name for PreviousPrioritiesConfig {
44 const NAME: &'static str = "PreviousPrioritiesConfig";
45 const PACKAGE: &'static str = "envoy.extensions.retry.priority.previous_priorities.v3";
46 fn full_name() -> ::prost::alloc::string::String {
47 "envoy.extensions.retry.priority.previous_priorities.v3.PreviousPrioritiesConfig"
48 .into()
49 }
50 fn type_url() -> ::prost::alloc::string::String {
51 "type.googleapis.com/envoy.extensions.retry.priority.previous_priorities.v3.PreviousPrioritiesConfig"
52 .into()
53 }
54}