Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/envoy/api/v2/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ api_proto_library_internal(
"//envoy/api/v2/core:base",
"//envoy/api/v2/core:health_check",
"//envoy/api/v2/endpoint",
"//envoy/type:percent",
],
)

Expand All @@ -52,6 +53,7 @@ api_go_grpc_library(
"//envoy/api/v2/core:base_go_proto",
"//envoy/api/v2/core:health_check_go_proto",
"//envoy/api/v2/endpoint:endpoint_go_proto",
"//envoy/type:percent_go_proto",
],
)

Expand Down
36 changes: 30 additions & 6 deletions api/envoy/api/v2/eds.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ option java_generic_services = true;

import "envoy/api/v2/discovery.proto";
import "envoy/api/v2/endpoint/endpoint.proto";
import "envoy/type/percent.proto";

import "google/api/annotations.proto";

Expand Down Expand Up @@ -50,12 +51,35 @@ message ClusterLoadAssignment {

// Load balancing policy settings.
message Policy {
// Percentage of traffic (0-100) that should be dropped. This
// action allows protection of upstream hosts should they unable to
// 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.

reserved 1;

message DropOverload {
// Identifier for the policy specifying the drop.
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.

}
// Action to trim the overall incoming traffic to protect the upstream
// hosts. This action allows protection in case the hosts are unable to
// recover from an outage, or unable to autoscale or unable to handle
// incoming traffic volume for any reason.
//
// At the client each category is applied one after the other to generate
// the 'actual' drop percentage on all outgoing traffic. For example:
//
// .. code-block:: json
//
// { "drop_overloads": [
// { "category": "throttle", "drop_percentage": 60 }
// { "category": "lb", "drop_percentage": 50 }
// ]}
//
// The actual drop percentages applied to the traffic at the clients will be
// "throttle"_drop = 60%
// "lb"_drop = 20% // 50% of the remaining 'actual' load, which is 40%.
// actual_outgoing_load = 20% // remaining after applying all categories.
repeated DropOverload drop_overloads = 2;
}

// Load balancing policy settings.
Expand Down
10 changes: 10 additions & 0 deletions api/envoy/api/v2/endpoint/load_report.proto
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ message ClusterStats {
// deliberately dropped by the drop_overload policy and circuit breaking.
uint64 total_dropped_requests = 3;

message DroppedRequests {
// Identifier for the policy specifying the drop.
string category = 1 [(validate.rules).string.min_bytes = 1];
// Total number of deliberately dropped requests for the category.
uint64 dropped_count = 2;
}
// Information about deliberately dropped requests for each category specified
// in the DropOverload policy.
repeated DroppedRequests dropped_requests = 5;

// Period over which the actual load report occurred. This will be guaranteed to include every
// request reported. Due to system load and delays between the *LoadStatsRequest* sent from Envoy
// and the *LoadStatsResponse* message sent from the management server, this may be longer than
Expand Down