diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 6da2b5b0f..3fc7f35d4 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -1529,6 +1529,13 @@ "required": false, "type": "boolean" }, + { + "name": "reportConfig", + "description": "Report Task Queue Config", + "in": "query", + "required": false, + "type": "boolean" + }, { "name": "includeTaskQueueStatus", "description": "Deprecated, use `report_stats` instead.\nIf true, the task queue status will be included in the response.", @@ -1610,6 +1617,52 @@ ] } }, + "/api/v1/namespaces/{namespace}/task-queues/{taskQueue}/update-config": { + "post": { + "summary": "Updates task queue configuration.\nFor the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit,\nwhich uncouples the rate limit from the worker lifecycle.\nIf the overall queue rate limit is unset, the worker-set rate limit takes effect.", + "operationId": "UpdateTaskQueueConfig2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateTaskQueueConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "taskQueue", + "description": "Selects the task queue to update.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateTaskQueueConfigBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/task-queues/{taskQueue}/worker-build-id-compatibility": { "get": { "summary": "Deprecated. Use `GetWorkerVersioningRules`.\nFetches the worker build id versioning sets for a task queue.", @@ -5176,6 +5229,13 @@ "required": false, "type": "boolean" }, + { + "name": "reportConfig", + "description": "Report Task Queue Config", + "in": "query", + "required": false, + "type": "boolean" + }, { "name": "includeTaskQueueStatus", "description": "Deprecated, use `report_stats` instead.\nIf true, the task queue status will be included in the response.", @@ -5257,6 +5317,52 @@ ] } }, + "/namespaces/{namespace}/task-queues/{taskQueue}/update-config": { + "post": { + "summary": "Updates task queue configuration.\nFor the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit,\nwhich uncouples the rate limit from the worker lifecycle.\nIf the overall queue rate limit is unset, the worker-set rate limit takes effect.", + "operationId": "UpdateTaskQueueConfig", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateTaskQueueConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "taskQueue", + "description": "Selects the task queue to update.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateTaskQueueConfigBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/task-queues/{taskQueue}/worker-build-id-compatibility": { "get": { "summary": "Deprecated. Use `GetWorkerVersioningRules`.\nFetches the worker build id versioning sets for a task queue.", @@ -6932,6 +7038,20 @@ } } }, + "DescribeTaskQueueResponseEffectiveRateLimit": { + "type": "object", + "properties": { + "requestsPerSecond": { + "type": "number", + "format": "float", + "description": "The effective rate limit for the task queue." + }, + "rateLimitSource": { + "$ref": "#/definitions/v1RateLimitSource", + "title": "Source of the RateLimit Configuration,which can be one of the following values:\n- SOURCE_API: The rate limit that is set via the TaskQueueConfig api.\n- SOURCE_WORKER: The rate limit is the value set using the workerOptions in TaskQueueActivitiesPerSecond.\n- SOURCE_SYSTEM: The rate limit is the default value set by the system" + } + } + }, "DescribeWorkerDeploymentVersionResponseVersionTaskQueue": { "type": "object", "properties": { @@ -7178,6 +7298,19 @@ }, "description": "An operation completed successfully." }, + "UpdateTaskQueueConfigRequestRateLimitUpdate": { + "type": "object", + "properties": { + "rateLimit": { + "$ref": "#/definitions/v1RateLimit", + "title": "Rate Limit to be updated" + }, + "reason": { + "type": "string", + "description": "Reason for why the rate limit was set." + } + } + }, "UpdateWorkerBuildIdCompatibilityRequestAddNewCompatibleVersion": { "type": "object", "properties": { @@ -8484,6 +8617,25 @@ } } }, + "WorkflowServiceUpdateTaskQueueConfigBody": { + "type": "object", + "properties": { + "identity": { + "type": "string" + }, + "taskQueueType": { + "$ref": "#/definitions/v1TaskQueueType" + }, + "updateQueueRateLimit": { + "$ref": "#/definitions/UpdateTaskQueueConfigRequestRateLimitUpdate", + "description": "Update to queue-wide rate limit.\nIf not set, this configuration is unchanged.\nNOTE: A limit set by the worker is overriden; and restored again when reset.\nIf the `rate_limit` field in the `RateLimitUpdate` is missing, remove the existing rate limit." + }, + "updateFairnessKeyRateLimitDefault": { + "$ref": "#/definitions/UpdateTaskQueueConfigRequestRateLimitUpdate", + "description": "Update to the default fairness key rate limit.\nIf not set, this configuration is unchanged.\nIf the `rate_limit` field in the `RateLimitUpdate` is missing, remove the existing rate limit." + } + } + }, "WorkflowServiceUpdateWorkerDeploymentVersionMetadataBody": { "type": "object", "properties": { @@ -9921,6 +10073,24 @@ } } }, + "v1ConfigMetadata": { + "type": "object", + "properties": { + "reason": { + "type": "string", + "description": "Reason for why the config was set." + }, + "updateIdentity": { + "type": "string", + "description": "Identity of the last updater.\nSet by the request's identity field." + }, + "updateTime": { + "type": "string", + "format": "date-time", + "description": "Time of the last update." + } + } + }, "v1ContinueAsNewInitiator": { "type": "string", "enum": [ @@ -10320,13 +10490,20 @@ "$ref": "#/definitions/v1PollerInfo" } }, + "versioningInfo": { + "$ref": "#/definitions/v1TaskQueueVersioningInfo", + "description": "Specifies which Worker Deployment Version(s) Server routes this Task Queue's tasks to.\nWhen not present, it means the tasks are routed to Unversioned workers (workers with\nUNVERSIONED or unspecified WorkerVersioningMode.)\nTask Queue Versioning info is updated indirectly by calling SetWorkerDeploymentCurrentVersion\nand SetWorkerDeploymentRampingVersion on Worker Deployments.\nNote: This information is not relevant to Pinned workflow executions and their activities as\nthey are always routed to their Pinned Deployment Version. However, new workflow executions\nare typically not Pinned until they complete their first task (unless they are started with\na Pinned VersioningOverride or are Child Workflows of a Pinned parent)." + }, "stats": { "$ref": "#/definitions/v1TaskQueueStats", "description": "Statistics for the task queue. Only populated when `report_stats` is set to true in the request." }, - "versioningInfo": { - "$ref": "#/definitions/v1TaskQueueVersioningInfo", - "description": "Specifies which Worker Deployment Version(s) Server routes this Task Queue's tasks to.\nWhen not present, it means the tasks are routed to Unversioned workers (workers with\nUNVERSIONED or unspecified WorkerVersioningMode.)\nTask Queue Versioning info is updated indirectly by calling SetWorkerDeploymentCurrentVersion\nand SetWorkerDeploymentRampingVersion on Worker Deployments.\nNote: This information is not relevant to Pinned workflow executions and their activities as\nthey are always routed to their Pinned Deployment Version. However, new workflow executions\nare typically not Pinned until they complete their first task (unless they are started with\na Pinned VersioningOverride or are Child Workflows of a Pinned parent)." + "config": { + "$ref": "#/definitions/v1TaskQueueConfig", + "description": "Only populated if report_task_queue_config is set to true." + }, + "effectiveRateLimit": { + "$ref": "#/definitions/DescribeTaskQueueResponseEffectiveRateLimit" }, "taskQueueStatus": { "$ref": "#/definitions/v1TaskQueueStatus", @@ -12711,6 +12888,38 @@ }, "description": "Range represents a set of integer values, used to match fields of a calendar\ntime in StructuredCalendarSpec. If end < start, then end is interpreted as\nequal to start. This means you can use a Range with start set to a value, and\nend and step unset (defaulting to 0) to represent a single value." }, + "v1RateLimit": { + "type": "object", + "properties": { + "requestsPerSecond": { + "type": "number", + "format": "float", + "description": "Zero is a valid rate limit." + } + } + }, + "v1RateLimitConfig": { + "type": "object", + "properties": { + "rateLimit": { + "$ref": "#/definitions/v1RateLimit" + }, + "metadata": { + "$ref": "#/definitions/v1ConfigMetadata" + } + } + }, + "v1RateLimitSource": { + "type": "string", + "enum": [ + "RATE_LIMIT_SOURCE_UNSPECIFIED", + "RATE_LIMIT_SOURCE_API", + "RATE_LIMIT_SOURCE_WORKER", + "RATE_LIMIT_SOURCE_SYSTEM" + ], + "default": "RATE_LIMIT_SOURCE_UNSPECIFIED", + "description": "Source for the effective rate limit.\n\n - RATE_LIMIT_SOURCE_API: The value was set by the API.\n - RATE_LIMIT_SOURCE_WORKER: The value was set by a worker.\n - RATE_LIMIT_SOURCE_SYSTEM: The value was set as the system default." + }, "v1RecordActivityTaskHeartbeatByIdResponse": { "type": "object", "properties": { @@ -14469,6 +14678,19 @@ }, "title": "See https://docs.temporal.io/docs/concepts/task-queues/" }, + "v1TaskQueueConfig": { + "type": "object", + "properties": { + "queueRateLimit": { + "$ref": "#/definitions/v1RateLimitConfig", + "description": "Unless modified, this is the system-defined rate limit." + }, + "fairnessKeysRateLimitDefault": { + "$ref": "#/definitions/v1RateLimitConfig", + "description": "If set, each individual fairness key will be limited to this rate, scaled by the weight of the fairness key." + } + } + }, "v1TaskQueueKind": { "type": "string", "enum": [ @@ -14925,6 +15147,14 @@ "v1UpdateScheduleResponse": { "type": "object" }, + "v1UpdateTaskQueueConfigResponse": { + "type": "object", + "properties": { + "config": { + "$ref": "#/definitions/v1TaskQueueConfig" + } + } + }, "v1UpdateWorkerBuildIdCompatibilityResponse": { "type": "object", "title": "[cleanup-wv-pre-release]" diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 5c3cccb7b..3b9718880 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -1300,6 +1300,47 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/task-queues/{taskQueue}/update-config: + post: + tags: + - WorkflowService + description: |- + Updates task queue configuration. + For the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit, + which uncouples the rate limit from the worker lifecycle. + If the overall queue rate limit is unset, the worker-set rate limit takes effect. + operationId: UpdateTaskQueueConfig + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: taskQueue + in: path + description: Selects the task queue to update. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTaskQueueConfigRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTaskQueueConfigResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/task-queues/{taskQueue}/worker-build-id-compatibility: get: tags: @@ -1433,6 +1474,11 @@ paths: description: Report stats for the requested task queue type(s). schema: type: boolean + - name: reportConfig + in: query + description: Report Task Queue Config + schema: + type: boolean - name: includeTaskQueueStatus in: query description: |- @@ -4571,6 +4617,47 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/task-queues/{taskQueue}/update-config: + post: + tags: + - WorkflowService + description: |- + Updates task queue configuration. + For the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit, + which uncouples the rate limit from the worker lifecycle. + If the overall queue rate limit is unset, the worker-set rate limit takes effect. + operationId: UpdateTaskQueueConfig + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: taskQueue + in: path + description: Selects the task queue to update. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTaskQueueConfigRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTaskQueueConfigResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/task-queues/{taskQueue}/worker-build-id-compatibility: get: tags: @@ -4704,6 +4791,11 @@ paths: description: Report stats for the requested task queue type(s). schema: type: boolean + - name: reportConfig + in: query + description: Report Task Queue Config + schema: + type: boolean - name: includeTaskQueueStatus in: query description: |- @@ -7135,6 +7227,21 @@ components: description: |- Used by the worker versioning APIs, represents an unordered set of one or more versions which are considered to be compatible with each other. Currently the versions are always worker build IDs. + ConfigMetadata: + type: object + properties: + reason: + type: string + description: Reason for why the config was set. + updateIdentity: + type: string + description: |- + Identity of the last updater. + Set by the request's identity field. + updateTime: + type: string + description: Time of the last update. + format: date-time CountWorkflowExecutionsResponse: type: object properties: @@ -7498,10 +7605,6 @@ components: type: array items: $ref: '#/components/schemas/PollerInfo' - stats: - allOf: - - $ref: '#/components/schemas/TaskQueueStats' - description: Statistics for the task queue. Only populated when `report_stats` is set to true in the request. versioningInfo: allOf: - $ref: '#/components/schemas/TaskQueueVersioningInfo' @@ -7515,6 +7618,16 @@ components: they are always routed to their Pinned Deployment Version. However, new workflow executions are typically not Pinned until they complete their first task (unless they are started with a Pinned VersioningOverride or are Child Workflows of a Pinned parent). + stats: + allOf: + - $ref: '#/components/schemas/TaskQueueStats' + description: Statistics for the task queue. Only populated when `report_stats` is set to true in the request. + config: + allOf: + - $ref: '#/components/schemas/TaskQueueConfig' + description: Only populated if report_task_queue_config is set to true. + effectiveRateLimit: + $ref: '#/components/schemas/DescribeTaskQueueResponse_EffectiveRateLimit' taskQueueStatus: allOf: - $ref: '#/components/schemas/TaskQueueStatus' @@ -7529,6 +7642,26 @@ components: Deprecated. Only returned in ENHANCED mode. This map contains Task Queue information for each Build ID. Empty string as key value means unversioned. + DescribeTaskQueueResponse_EffectiveRateLimit: + type: object + properties: + requestsPerSecond: + type: number + description: The effective rate limit for the task queue. + format: float + rateLimitSource: + enum: + - RATE_LIMIT_SOURCE_UNSPECIFIED + - RATE_LIMIT_SOURCE_API + - RATE_LIMIT_SOURCE_WORKER + - RATE_LIMIT_SOURCE_SYSTEM + type: string + description: |- + Source of the RateLimit Configuration,which can be one of the following values: + - SOURCE_API: The rate limit that is set via the TaskQueueConfig api. + - SOURCE_WORKER: The rate limit is the value set using the workerOptions in TaskQueueActivitiesPerSecond. + - SOURCE_SYSTEM: The rate limit is the default value set by the system + format: enum DescribeWorkerDeploymentResponse: type: object properties: @@ -9643,6 +9776,20 @@ components: time in StructuredCalendarSpec. If end < start, then end is interpreted as equal to start. This means you can use a Range with start set to a value, and end and step unset (defaulting to 0) to represent a single value. + RateLimit: + type: object + properties: + requestsPerSecond: + type: number + description: Zero is a valid rate limit. + format: float + RateLimitConfig: + type: object + properties: + rateLimit: + $ref: '#/components/schemas/RateLimit' + metadata: + $ref: '#/components/schemas/ConfigMetadata' RecordActivityTaskHeartbeatByIdRequest: type: object properties: @@ -11647,6 +11794,17 @@ components: Iff kind == TASK_QUEUE_KIND_STICKY, then this field contains the name of the normal task queue that the sticky worker is running on. description: See https://docs.temporal.io/docs/concepts/task-queues/ + TaskQueueConfig: + type: object + properties: + queueRateLimit: + allOf: + - $ref: '#/components/schemas/RateLimitConfig' + description: Unless modified, this is the system-defined rate limit. + fairnessKeysRateLimitDefault: + allOf: + - $ref: '#/components/schemas/RateLimitConfig' + description: If set, each individual fairness key will be limited to this rate, scaled by the weight of the fairness key. TaskQueueReachability: type: object properties: @@ -12187,6 +12345,54 @@ components: UpdateScheduleResponse: type: object properties: {} + UpdateTaskQueueConfigRequest: + type: object + properties: + namespace: + type: string + identity: + type: string + taskQueue: + type: string + description: Selects the task queue to update. + taskQueueType: + enum: + - TASK_QUEUE_TYPE_UNSPECIFIED + - TASK_QUEUE_TYPE_WORKFLOW + - TASK_QUEUE_TYPE_ACTIVITY + - TASK_QUEUE_TYPE_NEXUS + type: string + format: enum + updateQueueRateLimit: + allOf: + - $ref: '#/components/schemas/UpdateTaskQueueConfigRequest_RateLimitUpdate' + description: |- + Update to queue-wide rate limit. + If not set, this configuration is unchanged. + NOTE: A limit set by the worker is overriden; and restored again when reset. + If the `rate_limit` field in the `RateLimitUpdate` is missing, remove the existing rate limit. + updateFairnessKeyRateLimitDefault: + allOf: + - $ref: '#/components/schemas/UpdateTaskQueueConfigRequest_RateLimitUpdate' + description: |- + Update to the default fairness key rate limit. + If not set, this configuration is unchanged. + If the `rate_limit` field in the `RateLimitUpdate` is missing, remove the existing rate limit. + UpdateTaskQueueConfigRequest_RateLimitUpdate: + type: object + properties: + rateLimit: + allOf: + - $ref: '#/components/schemas/RateLimit' + description: Rate Limit to be updated + reason: + type: string + description: Reason for why the rate limit was set. + UpdateTaskQueueConfigResponse: + type: object + properties: + config: + $ref: '#/components/schemas/TaskQueueConfig' UpdateWorkerDeploymentVersionMetadataRequest: type: object properties: diff --git a/temporal/api/enums/v1/task_queue.proto b/temporal/api/enums/v1/task_queue.proto index e0d642914..7ddb8ebd6 100644 --- a/temporal/api/enums/v1/task_queue.proto +++ b/temporal/api/enums/v1/task_queue.proto @@ -89,3 +89,14 @@ enum DescribeTaskQueueMode { // Enhanced mode reports aggregated results for all partitions, supports Build IDs, and reports richer info. DESCRIBE_TASK_QUEUE_MODE_ENHANCED = 1; } + +// Source for the effective rate limit. +enum RateLimitSource { + RATE_LIMIT_SOURCE_UNSPECIFIED = 0; + // The value was set by the API. + RATE_LIMIT_SOURCE_API = 1; + // The value was set by a worker. + RATE_LIMIT_SOURCE_WORKER = 2; + // The value was set as the system default. + RATE_LIMIT_SOURCE_SYSTEM = 3; +} diff --git a/temporal/api/taskqueue/v1/message.proto b/temporal/api/taskqueue/v1/message.proto index 364c00595..4301e27a4 100644 --- a/temporal/api/taskqueue/v1/message.proto +++ b/temporal/api/taskqueue/v1/message.proto @@ -315,3 +315,32 @@ message PollerScalingDecision { // all slots are already occupied. int32 poll_request_delta_suggestion = 1; } + +message RateLimit { + // Zero is a valid rate limit. + float requests_per_second = 1; +} + +message ConfigMetadata { + // Reason for why the config was set. + string reason = 1; + + // Identity of the last updater. + // Set by the request's identity field. + string update_identity = 2; + + // Time of the last update. + google.protobuf.Timestamp update_time = 3; +} + +message RateLimitConfig { + RateLimit rate_limit = 1; + ConfigMetadata metadata = 2; +} + +message TaskQueueConfig { + // Unless modified, this is the system-defined rate limit. + RateLimitConfig queue_rate_limit = 1; + // If set, each individual fairness key will be limited to this rate, scaled by the weight of the fairness key. + RateLimitConfig fairness_keys_rate_limit_default = 2; +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 180dbba75..562535721 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1058,6 +1058,9 @@ message DescribeTaskQueueRequest { // Report stats for the requested task queue type(s). bool report_stats = 8; + // Report Task Queue Config + bool report_config = 11; + // Deprecated, use `report_stats` instead. // If true, the task queue status will be included in the response. bool include_task_queue_status = 4 [deprecated = true]; @@ -1091,9 +1094,6 @@ message DescribeTaskQueueRequest { message DescribeTaskQueueResponse { repeated temporal.api.taskqueue.v1.PollerInfo pollers = 1; - // Statistics for the task queue. Only populated when `report_stats` is set to true in the request. - temporal.api.taskqueue.v1.TaskQueueStats stats = 5; - // Specifies which Worker Deployment Version(s) Server routes this Task Queue's tasks to. // When not present, it means the tasks are routed to Unversioned workers (workers with // UNVERSIONED or unspecified WorkerVersioningMode.) @@ -1105,6 +1105,25 @@ message DescribeTaskQueueResponse { // a Pinned VersioningOverride or are Child Workflows of a Pinned parent). temporal.api.taskqueue.v1.TaskQueueVersioningInfo versioning_info = 4; + // Statistics for the task queue. Only populated when `report_stats` is set to true in the request. + temporal.api.taskqueue.v1.TaskQueueStats stats = 5; + + // Only populated if report_task_queue_config is set to true. + temporal.api.taskqueue.v1.TaskQueueConfig config = 6; + + message EffectiveRateLimit { + // The effective rate limit for the task queue. + float requests_per_second = 1; + + // Source of the RateLimit Configuration,which can be one of the following values: + // - SOURCE_API: The rate limit that is set via the TaskQueueConfig api. + // - SOURCE_WORKER: The rate limit is the value set using the workerOptions in TaskQueueActivitiesPerSecond. + // - SOURCE_SYSTEM: The rate limit is the default value set by the system + temporal.api.enums.v1.RateLimitSource rate_limit_source = 2; + } + + EffectiveRateLimit effective_rate_limit = 7; + // Deprecated. // Status of the task queue. Only populated when `include_task_queue_status` is set to true in the request. temporal.api.taskqueue.v1.TaskQueueStatus task_queue_status = 2 [deprecated = true]; @@ -2419,3 +2438,31 @@ message ListWorkersResponse { // Next page token bytes next_page_token = 2; } + +message UpdateTaskQueueConfigRequest { + message RateLimitUpdate { + // Rate Limit to be updated + temporal.api.taskqueue.v1.RateLimit rate_limit = 1; + // Reason for why the rate limit was set. + string reason = 2; + } + + string namespace = 1; + string identity = 2; + // Selects the task queue to update. + string task_queue = 3; + temporal.api.enums.v1.TaskQueueType task_queue_type = 4; + // Update to queue-wide rate limit. + // If not set, this configuration is unchanged. + // NOTE: A limit set by the worker is overriden; and restored again when reset. + // If the `rate_limit` field in the `RateLimitUpdate` is missing, remove the existing rate limit. + RateLimitUpdate update_queue_rate_limit = 5; + // Update to the default fairness key rate limit. + // If not set, this configuration is unchanged. + // If the `rate_limit` field in the `RateLimitUpdate` is missing, remove the existing rate limit. + RateLimitUpdate update_fairness_key_rate_limit_default = 6; +} + +message UpdateTaskQueueConfigResponse { + temporal.api.taskqueue.v1.TaskQueueConfig config = 1; +} diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index bfa622dcd..eb78ead74 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1194,4 +1194,19 @@ service WorkflowService { } }; } + + // Updates task queue configuration. + // For the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit, + // which uncouples the rate limit from the worker lifecycle. + // If the overall queue rate limit is unset, the worker-set rate limit takes effect. + rpc UpdateTaskQueueConfig (UpdateTaskQueueConfigRequest) returns (UpdateTaskQueueConfigResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/task-queues/{task_queue}/update-config" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/task-queues/{task_queue}/update-config" + body: "*" + } + }; + } }