Skip to content

extenstions: retry predicate - omit_canary_hosts#7230

Merged
snowp merged 7 commits intoenvoyproxy:masterfrom
sriduth:feature/retry-on-non-canary-host
Jun 20, 2019
Merged

extenstions: retry predicate - omit_canary_hosts#7230
snowp merged 7 commits intoenvoyproxy:masterfrom
sriduth:feature/retry-on-non-canary-host

Conversation

@sriduth
Copy link
Copy Markdown
Contributor

@sriduth sriduth commented Jun 11, 2019

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:]

Copy link
Copy Markdown
Contributor

@snowp snowp left a 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.

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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?

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

sriduth added 2 commits June 13, 2019 10:48
…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 <sriduth.jayhari@juspay.in>
…anary_hosts` retry predicate in

docs/root/intro/arch_overview/http_connection_management.rst

Signed-off-by: Sriduth Jayhari <sriduth.jayhari@juspay.in>
@sriduth sriduth force-pushed the feature/retry-on-non-canary-host branch from e6e7f4e to 06e27c4 Compare June 13, 2019 06:45
* 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 <sriduth.jayhari@juspay.in>
@sriduth sriduth force-pushed the feature/retry-on-non-canary-host branch from 06e27c4 to 266f00f Compare June 13, 2019 06:55
Copy link
Copy Markdown
Contributor

@snowp snowp left a 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 <sriduth.jayhari@juspay.in>
@snowp
Copy link
Copy Markdown
Contributor

snowp commented Jun 18, 2019

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.

@snowp snowp added the waiting label Jun 18, 2019
@sriduth sriduth marked this pull request as ready for review June 18, 2019 16:47
@snowp
Copy link
Copy Markdown
Contributor

snowp commented Jun 18, 2019

Seems like there's a CI failure

/wait

@sriduth sriduth requested a review from lizan as a code owner June 19, 2019 01:56
@sriduth sriduth force-pushed the feature/retry-on-non-canary-host branch from 2ba14cd to 3d1bc6b Compare June 19, 2019 01:58
@sriduth
Copy link
Copy Markdown
Contributor Author

sriduth commented Jun 19, 2019

@snowp , running tools/check_format.py fix has touched a lot of other files as well. I have clang-format version 7.0.1 (tags/RELEASE_701/final) and buildifier from eb1a85ca787f0f5f94ba66f41ee66fdfd4c49b70 (tag: 0.26.0). Am I doing something wrong?

Should I revert the last 2 commits (format fix and master merge)?

@snowp
Copy link
Copy Markdown
Contributor

snowp commented Jun 19, 2019

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 <sriduth.jayhari@juspay.in>
@sriduth sriduth force-pushed the feature/retry-on-non-canary-host branch from 3d1bc6b to 93e440e Compare June 19, 2019 17:00
@sriduth
Copy link
Copy Markdown
Contributor Author

sriduth commented Jun 19, 2019

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:

  • tools/check_format.py fix source/extensions/retry/host/omit_canary_hosts
  • tools/check_format.py fix source/extensions/retry/host
  • tools/check_format.py fix test/extensions/retry/host
  • tools/check_format.py fix test/extensions/retry/host/omit_canary_hosts

git diff master --name-only is now:

docs/root/intro/arch_overview/http/http_connection_management.rst
docs/root/intro/version_history.rst
source/extensions/extensions_build_config.bzl
source/extensions/retry/host/omit_canary_hosts/BUILD
source/extensions/retry/host/omit_canary_hosts/config.cc
source/extensions/retry/host/omit_canary_hosts/config.h
source/extensions/retry/host/omit_canary_hosts/omit_canary_hosts.h
source/extensions/retry/host/previous_hosts/config.h
source/extensions/retry/host/well_known_names.h
test/extensions/retry/host/omit_canary_hosts/BUILD
test/extensions/retry/host/omit_canary_hosts/config_test.cc

@sriduth
Copy link
Copy Markdown
Contributor Author

sriduth commented Jun 20, 2019

Should I add this to the CODEOWNERS file?

ERROR: New directory extensions/retry/host/omit_canary_hosts appears to not have owners in CODEOWNERS
ERROR: check format failed. run 'tools/check_format.py fix'

@snowp
Copy link
Copy Markdown
Contributor

snowp commented Jun 20, 2019

Yeah, please add yourself and me as the code owners.

Signed-off-by: Sriduth Jayhari <sriduth.jayhari@juspay.in>
Copy link
Copy Markdown
Contributor

@snowp snowp left a 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 <sriduth.jayhari@juspay.in>
@sriduth sriduth force-pushed the feature/retry-on-non-canary-host branch from 1b31992 to 21d3b9b Compare June 20, 2019 19:44
Copy link
Copy Markdown
Contributor

@snowp snowp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@snowp snowp merged commit 2e03ef2 into envoyproxy:master Jun 20, 2019
sriduth added a commit to sriduth/envoy that referenced this pull request Jun 25, 2019
…oyproxy#7230

Signed-off-by: Sriduth Jayhari <sriduth.jayhari@juspay.in>
mattklein123 pushed a commit that referenced this pull request Jun 25, 2019
… (#7394)

Signed-off-by: Sriduth Jayhari <sriduth.jayhari@juspay.in>
@mcasper
Copy link
Copy Markdown

mcasper commented Jul 1, 2019

It looks like this feature was added to the version 1.10 release notes, was that a mistake?

@sriduth
Copy link
Copy Markdown
Contributor Author

sriduth commented Jul 2, 2019

@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.

sriduth added a commit to sriduth/envoy that referenced this pull request Jul 2, 2019
…r v1.11 version

      history.

Signed-off-by: Sriduth Jayhari <sriduth.jayhari@juspay.in>
mattklein123 pushed a commit that referenced this pull request Jul 2, 2019
…rsion (#7444)

history.

Signed-off-by: Sriduth Jayhari <sriduth.jayhari@juspay.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

extenstion / feature request - omit canary hosts during retry of a failed request

3 participants