-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
router: implement RetryPriority #4437
Conversation
This wires up the necessary logic to allow registering a RetryPriorityFactory that can be used to impact which priority is selected during host selection for retry attempts. Signed-off-by: Snow Pettersen <snowp@squareup.com>
Signed-off-by: Snow Pettersen <snowp@squareup.com>
For some reason the linker is failing in CI:
|
Signed-off-by: Snow Pettersen <snowp@squareup.com>
Signed-off-by: Snow Pettersen <snowp@squareup.com>
@dio Mind giving this a look? |
Signed-off-by: Snow Pettersen <snowp@squareup.com>
@snowp sorry for the late response here. Will take a look today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and it seems this is really useful.
A doc question and a nit.
envoy::api::v2::route::RouteAction::NOT_FOUND, | ||
envoy::api::v2::route::VirtualHost::NONE, retry_policy); | ||
|
||
// Use load assignments instead of static hosts. Necessary in order to use priorities. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a note regarding this somewhere in the doc? I think it will be useful for the operator to be aware of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's really just a consequence of the API, so I don't think it's documented anywhere explicitly. Looks like load_assignment deprecates
the static host list (https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/cds.proto#envoy-api-field-cluster-load-assignment), so I don't think there is much to be gained by documenting the the difference.
Afaik it's just because priorities were introduced with EDS, and the recently added load_assignment
brings those features back into the cluster itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Thanks for the clarification.
include/envoy/upstream/retry.h
Outdated
@@ -105,7 +105,10 @@ class RetryPriorityFactory { | |||
public: | |||
virtual ~RetryPriorityFactory() {} | |||
|
|||
virtual void createRetryPriority(RetryPriorityFactoryCallbacks& callbacks) PURE; | |||
virtual void createRetryPriority(RetryPriorityFactoryCallbacks& callbacks, | |||
const ProtobufWkt::Message& config) PURE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny nit: Protobuf::Message&
instead of ProtobufWkt::Message&
.
Signed-off-by: Snow Pettersen <snowp@squareup.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks @snowp
This wires up the necessary logic to allow registering a
RetryPriorityFactory that can be used to impact which priority is
selected during host selection for retry attempts.
Signed-off-by: Snow Pettersen snowp@squareup.com
Description:
Risk Level: Low, new optional feautre
Testing: Integration test
Docs Changes: n/a
Release Notes: n/a
Part of #3958