Skip to content
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

Merged
merged 1 commit into from
Jul 25, 2018

Conversation

vishalpowar
Copy link
Contributor

This PR contains changes to implement feature requested in issue #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.

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

@vishalpowar vishalpowar force-pushed the vishalpowar-drop-category branch 4 times, most recently from 5a5bc32 to d449441 Compare July 20, 2018 17:13
Copy link
Member

@zuercher zuercher 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 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}];
Copy link
Member

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?

Copy link
Member

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.

}
// 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
Copy link
Member

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

Copy link
Contributor Author

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.
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

// 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];
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

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

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed validation.


message DropOverload {
// Name of the drop policy.
string category = 1;
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@htuch htuch self-assigned this Jul 24, 2018
Copy link
Member

@htuch htuch left a 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
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

reserved 1;

message DropOverload {
// Name of the drop policy.
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

string category = 1;

// Percentage of traffic (0-100) that should be dropped.
double drop_percentage = 2 [(validate.rules).double = {gte: 0, lte: 100}];
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

// 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
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@vishalpowar vishalpowar force-pushed the vishalpowar-drop-category branch 4 times, most recently from 443b195 to 9cc3f3b Compare July 25, 2018 01:24
Copy link
Member

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

// 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">
Copy link
Member

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

Copy link
Contributor Author

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;
Copy link
Member

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.

Copy link
Contributor Author

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

@htuch
Copy link
Member

htuch commented Jul 25, 2018

Also, looks like build is broken @vishalpowar

@vishalpowar vishalpowar force-pushed the vishalpowar-drop-category branch 3 times, most recently from b5e8b34 to 4ddabc1 Compare July 25, 2018 19:37
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>
@vishalpowar vishalpowar force-pushed the vishalpowar-drop-category branch from 4ddabc1 to 6839b73 Compare July 25, 2018 20:57
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Awesome, thanks.

@zuercher zuercher merged commit 3ee3aa3 into envoyproxy:master Jul 25, 2018
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;
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Member

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.

@vishalpowar vishalpowar deleted the vishalpowar-drop-category branch July 27, 2018 21:43
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.

4 participants