Skip to content

Commit

Permalink
Batch operation rate limit (#318)
Browse files Browse the repository at this point in the history
## What changed?

Adding (optional) max_operations_per_second for batch operations to limit their rate.

## Why?

To fix temporalio/temporal#4926.
  • Loading branch information
stephanos committed Oct 27, 2023
1 parent 108b40a commit 01c32e4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions temporal/api/workflowservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1242,15 +1242,22 @@ message StartBatchOperationRequest {
// Namespace that contains the batch operation
string namespace = 1;
// Visibility query defines the the group of workflow to apply the batch operation
// This field and Executions are mutually exclusive
// This field and `executions` are mutually exclusive
string visibility_query = 2;
// Job ID defines the unique ID for the batch job
string job_id = 3;
// Reason to perform the batch operation
string reason = 4;
// Executions to apply the batch operation
// This field and VisibilityQuery are mutually exclusive
// This field and `visibility_query` are mutually exclusive
repeated temporal.api.common.v1.WorkflowExecution executions = 5;
// Limit for the number of operations processed per second within this batch.
// Its purpose is to reduce the stress on the system caused by batch operations, which helps to prevent system
// overload and minimize potential delays in executing ongoing tasks for user workers.
// Note that when no explicit limit is provided, the server will operate according to its limit defined by the
// dynamic configuration key `worker.batcherRPS`. This also applies if the value in this field exceeds the
// server's configured limit.
float max_operations_per_second = 6;
// Operation input
oneof operation {
temporal.api.batch.v1.BatchOperationTermination termination_operation = 10;
Expand Down

0 comments on commit 01c32e4

Please sign in to comment.