-
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
Add support for drop category policy and reporting #3894
Add support for drop category policy and reporting #3894
Conversation
5a5bc32
to
d449441
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.
Thanks for taking this on. I have a few questions and found a couple typos, but I think it's headed in the right direction.
// recover from an outage or should they be unable to autoscale and hence | ||
// overall incoming traffic volume need to be trimmed to protect them. | ||
// [#v2-api-diff: This is known as maintenance mode in v1.] | ||
double drop_overload = 1 [(validate.rules).double = {gte: 0, lte: 100}]; |
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.
I gather this was never implemented, but do we need to keep this in place (but marked deprecated) until 1.8.0 on the off chance that someone is setting it?
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.
I think it's reasonable to skip it. If someone is setting a hidden/unimplemented field, I don't think we need to be applying the policy. Maybe we should clarify it to make this explicit if it isn't already.
api/envoy/api/v2/eds.proto
Outdated
} | ||
// Action to trim the overall incoming traffic to protect the upstream | ||
// hosts. This action allows protection in case the hosts are unable to | ||
// recover rom an outage, or unable to autoscale or unable to handle |
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.
typo: rom; also drop the first or
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.
done
message DroppedRequests { | ||
// Name of the drop policy. | ||
string category = 1; | ||
// Total number of deliberately dropped request for the category. |
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.
typo: request should be requests
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.
done
// Total number of deliberately dropped request for the category. | ||
uint64 dropped_count = 2; | ||
} | ||
// Information about deliberately dropped request for each category specified |
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.
typo: request should be requests
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.
done
api/envoy/api/v2/eds.proto
Outdated
// recover rom an outage, or unable to autoscale or unable to handle | ||
// incoming traffic volume for any reason. | ||
repeated DropOverload drop_overloads = 2 | ||
[(validate.rules).repeated.min_items = 1]; |
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.
I'm not sure about this validation. If there are other, unrelated policy settings in the future we won't want to require this one.
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.
+1
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.
Removed validation.
api/envoy/api/v2/eds.proto
Outdated
|
||
message DropOverload { | ||
// Name of the drop policy. | ||
string category = 1; |
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.
Should this have a validation rule to prevent it from being an empty string?
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.
Done
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.
Yep, thanks for making this happen.
DEPRECATED.md
Outdated
@@ -23,6 +23,8 @@ A logged warning is expected for each deprecated item that is in deprecation win | |||
is deprecated. Please use the new `upgrade_configs` in the | |||
[HttpConnectionManager](https://github.com/envoyproxy/envoy/blob/master/api/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto) | |||
instead. | |||
* Use of 'drop_overload' in ClusterLoadAssignment.Policy is deprecated and |
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.
I would just drop this, it's a hidden field.
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.
removed
api/envoy/api/v2/eds.proto
Outdated
reserved 1; | ||
|
||
message DropOverload { | ||
// Name of the drop policy. |
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.
Identifier for the policy specifying the drop.`
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.
updated
api/envoy/api/v2/eds.proto
Outdated
string category = 1; | ||
|
||
// Percentage of traffic (0-100) that should be dropped. | ||
double drop_percentage = 2 [(validate.rules).double = {gte: 0, lte: 100}]; |
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.
Please use envoy.type.Percent
here.
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.
Done
api/envoy/api/v2/eds.proto
Outdated
// Percentage of traffic (0-100) that should be dropped. | ||
double drop_percentage = 2 [(validate.rules).double = {gte: 0, lte: 100}]; | ||
} | ||
// Action to trim the overall incoming traffic to protect the upstream |
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.
Can you provide the full explanation in the comments here for how drop policy is applied, including the worked example from your doc? These comments get rendered into docs.
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.
Done
443b195
to
9cc3f3b
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 modulo remaining comments.
api/envoy/api/v2/eds.proto
Outdated
// At the client each category is applied one after the other to generate | ||
// the 'actual' drop percentage on all outgoing traffic. | ||
// e.g. If the following drop overload is received | ||
// <category="throttle", drop_percentage="60"> |
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.
Nit: Please use JSON or YAML examples, even for pseudo-code. There is no XML in the Envoy code base :)
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.
Done
@@ -93,9 +93,19 @@ message ClusterStats { | |||
// sum_locality(total_error_requests) + total_dropped_requests` | |||
// | |||
// The total number of dropped requests. This covers requests | |||
// deliberately dropped by the drop_overload policy and circuit breaking. | |||
// deliberately dropped by the circuit breaking. | |||
uint64 total_dropped_requests = 3; |
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.
I think this can also be deprecated, since it can be inferred from dropped_requests
now. Better to be concise in APIs.
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.
Yes, I did not want to do this as it is implemented.
I am open to doing those changes in subsequent PRs
Also, looks like build is broken @vishalpowar |
b5e8b34
to
4ddabc1
Compare
This PR contains changes to implement feature requested in issue envoyproxy#3823 - Adding DropOverload in eds policy which can be used to specify drop_percentage per category. - Adding DroppedRequests in load_report which can report deliberately dropped requests for each category. Signed-off-by: vishalpowar <vishal.powar@gmail.com>
4ddabc1
to
6839b73
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.
Awesome, thanks.
string category = 1 [(validate.rules).string.min_bytes = 1]; | ||
|
||
// Percentage of traffic that should be dropped for the category. | ||
envoy.type.Percent drop_percentage = 2; |
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.
@vishalpowar I'm a little late here, but I would recommend using FractionalPercent
here. It will be higher performance in the data path. cc @zuercher @htuch
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.
I can do that in another PR (this one is already merged) unless there is any restriction on making such changes in two different PRs.
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.
@vishalpowar I would just do a follow up PR, it's fine to change it now since it just merged and no one is using it, unless there are objections from others, but we can discuss that in the follow up.
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.
Yeah, sure, FractionalPercent
makes sense here.
This PR contains changes to implement feature requested in issue #3823
drop_percentage per category.
dropped requests for each category.
For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md
Description:
Risk Level:
Testing: None
Docs Changes: None
Release Notes:
Fixes #3823