-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
extenstions: retry predicate - omit_canary_hosts #7230
extenstions: retry predicate - omit_canary_hosts #7230
Conversation
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.
Thanks for working on this! This seems like exactly what I was thinking, just have some comments about style/conventions.
You'll also want to fix DCO (https://github.com/envoyproxy/envoy/blob/master/CONTRIBUTING.md#fixing-dco) and format the files using tools/check_format.py fix
.
@@ -60,6 +60,9 @@ can be used to modify this behavior, and they fall into two categories: | |||
* *envoy.retry_host_predicates.previous_hosts*: This will keep track of previously attempted hosts, and rejects | |||
hosts that have already been attempted. | |||
|
|||
* *community.retry_host_predicates.omit_canary_hosts*: This will ensure that a retry will always be done on |
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.
Since this extension lives in the envoy repo we'll want to prefix the name with envoy
like all the other extensions
std::string name() override { return RetryHostPredicateValues::get().OmitCanaryHostsPredicate; } | ||
|
||
ProtobufTypes::MessagePtr createEmptyConfigProto() override { | ||
return ProtobufTypes::MessagePtr{new Envoy::ProtobufWkt::Empty()}; |
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.
Use std::make_unique
instead of explicit new
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.
Sure! I got started on this PR by copying the sources of the previous_hosts
extensions, can I make this change there also?
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.
Sure, I wouldn't mind the cleanup
namespace Envoy { | ||
class OmitCanaryHostsRetryPredicate : public Upstream::RetryHostPredicate { | ||
public: | ||
OmitCanaryHostsRetryPredicate() {} |
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.
this does nothing, you can just remove it
…nvoyproxy#7203) In case a user wants to deploy a new change, this can help in cases where any failure in the canary downstream is retried in a stable downstream. Signed-off-by: Sriduth Jayhari <[email protected]>
…anary_hosts` retry predicate in docs/root/intro/arch_overview/http_connection_management.rst Signed-off-by: Sriduth Jayhari <[email protected]>
e6e7f4e
to
06e27c4
Compare
* Format code * Remove empty OmitCanaryHostsRetryPredicate constructor * Cleanup: Use std::unique_ptr to make empty proto config for all host based predicates * Fix extenstion name in unit test and well_known_names.h Signed-off-by: Sriduth Jayhari <[email protected]>
06e27c4
to
266f00f
Compare
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.
Nice this looks pretty good. Just a few minor comments. Could you add a release note for this as well?
* Added release note * Improve documentation * return unique_ptr of Envoy::ProtobufWkt::Empty instead of wrapping with a message ptr in createEmptyProto (also added for previous hosts predicate) Signed-off-by: Sriduth Jayhari <[email protected]>
This looks good to me. Could you merge master and see if CI is okay? You can also move this out of Draft mode at this point. |
Seems like there's a CI failure /wait |
2ba14cd
to
3d1bc6b
Compare
@snowp , running Should I revert the last 2 commits (format fix and master merge)? |
Yeah please avoid changing files not related to this change. I tend to run the format script just on the files I've changed in a PR instead of on the whole repo to avoid this kinda stuff from happening. |
Signed-off-by: Sriduth Jayhari <[email protected]>
3d1bc6b
to
93e440e
Compare
I should have checked the help section of the check_format.py script - my bad! I've run the following and no diff is produced:
|
Should I add this to the
|
Yeah, please add yourself and me as the code owners. |
Signed-off-by: Sriduth Jayhari <[email protected]>
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.
Thanks this is looking really good, just a couple nits.
* Remove unrequired empty line in documentation for the predicate in http_connection_management.rst * Improve wording and formatting that describes change in version_history.rst Signed-off-by: Sriduth Jayhari <[email protected]>
1b31992
to
21d3b9b
Compare
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.
LGTM, thanks!
…oyproxy#7230 Signed-off-by: Sriduth Jayhari <[email protected]>
… (#7394) Signed-off-by: Sriduth Jayhari <[email protected]>
It looks like this feature was added to the version |
@mcasper you are right! i created the feature branch off the v.1.10.0 commit. This is bad - I'll open a PR to fix this right away. |
…r v1.11 version history. Signed-off-by: Sriduth Jayhari <[email protected]>
…rsion (#7444) history. Signed-off-by: Sriduth Jayhari <[email protected]>
Description: Created a new retry predicate that will reject canary hosts when selecting a host to retry a failure.
Risk Level: Low
Testing: Unit Tests added, manual testing done (1 canary host, 1 non canary host)
Docs Changes: Added brief description in
docs/root/intro/arch_overview/http_connection_management.rst
Release Notes: N/A
[Optional Fixes #Issue] Fixes #7203
[Optional Deprecated:]