RetryConstraint defines the configuration for when to allow or prevent
further retries to a target backend, by dynamically calculating a 'retry
budget'. This budget is calculated based on the percentage of incoming
traffic composed of retries over a given time interval. Once the budget
is exceeded, additional retries will be rejected.
For example, if the retry budget interval is 10 seconds, there have been
1000 active requests in the past 10 seconds, and the allowed percentage
of requests that can be retried is 20% (the default), then 200 of those
requests may be composed of retries. Active requests will only be
considered for the duration of the interval when calculating the retry
budget. Retrying the same original request multiple times within the
retry budget interval will lead to each retry being counted towards
calculating the budget.
Configuring a RetryConstraint in BackendTrafficPolicy is compatible with
HTTPRoute Retry settings for each HTTPRouteRule that targets the same
backend. While the HTTPRouteRule Retry stanza can specify whether a
request will be retried, and the number of retry attempts each client
may perform, RetryConstraint helps prevent cascading failures such as
retry storms during periods of consistent failures.
After the retry budget has been exceeded, additional retries to the
backend MUST return a 503 response to the client.
Additional configurations for defining a constraint on retries MAY be
defined in the future.
Support: Extended
budget
object
Budget holds the details of the retry budget configuration.
interval
string
Interval defines the duration in which requests will be considered
for calculating the budget for retries.
Support: Extended
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
percent
integer
Percent defines the maximum percentage of active requests that may
be made up of retries.
Support: Extended
minimum: 0
maximum: 100
minRetryRate
object
MinRetryRate defines the minimum rate of retries that will be allowable
over a specified duration of time.
The effective overall minimum rate of retries targeting the backend
service may be much higher, as there can be any number of clients which
are applying this setting locally.
This ensures that requests can still be retried during periods of low
traffic, where the budget for retries may be calculated as a very low
value.
Support: Extended
count
integer
Count specifies the number of requests per time interval.
Support: Extended
minimum: 1
maximum: 1e+06
interval
string
Interval specifies the divisor of the rate of requests, the amount of
time during which the given count of requests occur.
Support: Extended
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$