Skip to content

outlier_detection: add optional random jitter to ejection time - #19869

Merged
adisuissa merged 22 commits into
envoyproxy:mainfrom
asheryerm:outlier_jitter
Feb 19, 2022
Merged

adisuissa merged 22 commits into
envoyproxy:mainfrom
asheryerm:outlier_jitter

Conversation

@asheryerm

@asheryerm asheryerm commented Feb 8, 2022 •

Copy link
Copy Markdown
Contributor

Signed-off-by: asheryer [email protected]

Commit Message: This commit adds a configuration that allows you to add a random jitter to the ejection time of outliers

Additional Description: This feature is aimed at preventing connection storms where thousands of hosts are unejected
at the same time. Specifically, we have seen this issue in AWS where thousands of Envoys are connected to a Redis node and are all unejected at the same time. This creates a 'connection storm' and overwhelms the redis-server. The default value of the jitter is zero. This makes it backward compatible and will not break
existing deployments. The configuration allows you to define a maximum jitter value. For example, if you set the
maximum jitter value to 10s, a random value between 0s and 10s will be added to the ejection time of every host,
thus preventing them from possibly all being unejected at the same time.

Risk Level: Low

Testing: Has been tested with a redis cluster with several dozen envoys connected to it. Coverage tests performed
as well. Has also been tested with Envoy running on Docker. We also tested the default behaviour where the configuration is not present, in this scenario the max_jitter defaults to 0, and everything behaves exactly as it did before.

Docs Changes:
Inline documentation in api/envoy/config/cluster/v3/outlier_detection.proto
Documentation added to docs/root/configuration/upstream/cluster_manager/cluster_runtime.rst

Release Notes:
Listed the change in docs/root/version_history/current.rst

Platform Specific Features: N/A

[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

@repokitteh-read-only

Copy link
Copy Markdown

Hi @asheryerm, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #19869 was opened by asheryerm.

see: more, trace.

@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @mattklein123
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #19869 was opened by asheryerm.

see: more, trace.

@mattklein123 mattklein123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks in general this makes sense to me. Can you check CI? This will also need tests. Thank you.

/wait

Comment thread docs/root/version_history/current.rst Resolved

@adisuissa adisuissa left a comment

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.

Thanks for working on this.
Left a comment regarding backwards compatibility.
/wait

adisuissa
adisuissa previously approved these changes Feb 9, 2022

@adisuissa adisuissa left a comment

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.

LGTM, thanks!

@repokitteh-read-only repokitteh-read-only Bot removed the api label Feb 9, 2022
Signed-off-by: asheryer <[email protected]>

@adisuissa adisuissa left a comment

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.

Thanks!
Left a few more comments.

Signed-off-by: asheryer <[email protected]>
mattklein123
mattklein123 previously approved these changes Feb 11, 2022

@mattklein123 mattklein123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks LGTM at a high level. Will defer to @adisuissa for final review and merge since he has been looking at this.

Signed-off-by: asheryer <[email protected]>
Signed-off-by: asheryer <[email protected]>
Signed-off-by: asheryer <[email protected]>

@adisuissa adisuissa left a comment

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.

Thanks, left a couple of nits, but overall LGTM!

@adisuissa adisuissa left a comment

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.

LGTM, small nit on the docs, but other than that it is good to go.
Thanks for adding this feature!
/wait

Comment thread docs/root/version_history/current.rst Outdated

* data plane: fixing error handling where writing to a socket failed while under the stack of processing. This should genreally affect HTTP/3. This behavioral change can be reverted by setting ``envoy.reloadable_features.allow_upstream_inline_write`` to false.
* eds: fix the eds cluster update by allowing update on the locality of the cluster endpoints. This behavioral change can be temporarily reverted by setting runtime guard ``envoy.reloadable_features.support_locality_update_on_eds_cluster_endpoints`` to false.
* outlier_detection: :ref:`max_ejection_time_jitter<envoy_v3_api_field_config.cluster.v3.OutlierDetection.base_ejection_time>` configuration added to allow adding a random value to the ejection time to prevent 'thundering herd' scenarios. Defaults to 0 so as to not break or change the behavior of existing deployments.

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.

nit: Let's move this down to New Features section.

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.

@adisuissa Done.

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.

@adisuissa Thanks for the time and effort you spent reviewing this feature!

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.

@adisuissa Coverage test timed out

@adisuissa

Copy link
Copy Markdown
Contributor

/lgtm api
/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #19869 (comment) was created by @adisuissa.

see: more, trace.

Signed-off-by: asheryer <[email protected]>
@adisuissa

Copy link
Copy Markdown
Contributor

LGTM changes.
We'll run the tests again, but maybe you'll need to merge main to get this solved.
/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #19869 (comment) was created by @adisuissa.

see: more, trace.

@adisuissa

Copy link
Copy Markdown
Contributor

Retesting doesn't work.
Can you please try merging main, I think it will fix this issue.
/wait

@adisuissa

Copy link
Copy Markdown
Contributor

CI verify-examples seems to be flaky (not related to this PR)
/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #19869 (comment) was created by @adisuissa.

see: more, trace.

@adisuissa

Copy link
Copy Markdown
Contributor

@mattklein123 this PR LGTM, if you'd like to take a final look.
It is blocked on the verify-examples CI issue (#20037), but other than that I think it can be merged.

@mattklein123 mattklein123 self-assigned this Feb 18, 2022
@adisuissa

Copy link
Copy Markdown
Contributor

The verify-examples issue should be fixed after #20038.
@asheryerm please merge main again.

@adisuissa

Copy link
Copy Markdown
Contributor

Thanks for your patience!
Merging per Matt's comment.

@adisuissa
adisuissa merged commit 1585359 into envoyproxy:main Feb 19, 2022
@asheryerm
asheryerm deleted the outlier_jitter branch February 19, 2022 06:56
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.

3 participants