diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 2e9a6a64b..b7f23609d 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -8208,6 +8208,10 @@ "queryRejectCondition": { "$ref": "#/definitions/v1QueryRejectCondition", "description": "QueryRejectCondition can used to reject the query if workflow state does not satisfy condition.\nDefault: QUERY_REJECT_CONDITION_NONE." + }, + "pinnedVersioningBehaviorQueryFallback": { + "$ref": "#/definitions/v1PinnedVersioningBehaviorQueryFallback", + "description": "Specifies the fallback behavior for Queries sent to Pinned Workflow executions." } } }, @@ -13342,6 +13346,29 @@ ], "default": "PENDING_WORKFLOW_TASK_STATE_UNSPECIFIED" }, + "v1PinnedVersioningBehaviorQueryFallback": { + "type": "string", + "enum": [ + "PINNED_VERSIONING_BEHAVIOR_QUERY_FALLBACK_UNSPECIFIED", + "PINNED_VERSIONING_BEHAVIOR_QUERY_FALLBACK_NEXT_PINNED_WITH_POLLERS" + ], + "default": "PINNED_VERSIONING_BEHAVIOR_QUERY_FALLBACK_UNSPECIFIED", + "description": "Specifies the fallback behavior for Queries, of a Pinned workflow execution, that are sent to a Drained and poller less version.\n\n - PINNED_VERSIONING_BEHAVIOR_QUERY_FALLBACK_UNSPECIFIED: This is the default behavior. Queries will not fallback to any other version by default.\n - PINNED_VERSIONING_BEHAVIOR_QUERY_FALLBACK_NEXT_PINNED_WITH_POLLERS: The Query will be sent to the next Pinned Version that has pollers. \nIf no such version exists, the Query will return an error." + }, + "v1PinnedVersioningBehaviorQueryFallbackInfo": { + "type": "object", + "properties": { + "pinnedDeploymentVersion": { + "$ref": "#/definitions/v1WorkerDeploymentVersion", + "description": "The Deployment Version on which the Query was scheduled to be executed on." + }, + "fallbackDeploymentVersion": { + "$ref": "#/definitions/v1WorkerDeploymentVersion", + "description": "The Deployment Version on which the Query was executed on." + } + }, + "description": "Used as part of QueryWorkflowResponse to indicate that a Query, of a Pinned workflow execution, fell back and \nwas executed by workers of a different version." + }, "v1PluginInfo": { "type": "object", "properties": { @@ -13669,6 +13696,10 @@ }, "queryRejected": { "$ref": "#/definitions/v1QueryRejected" + }, + "pinnedVersioningBehaviorQueryFallbackInfo": { + "$ref": "#/definitions/v1PinnedVersioningBehaviorQueryFallbackInfo", + "description": "Only populated when a Query of a Pinned workflow execution gets executed by workers of a different version \nbecause the workflow's Pinned Version was Drained and had no available pollers." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 045315d92..bd702d93f 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -10081,6 +10081,18 @@ components: attempt: type: integer format: int32 + PinnedVersioningBehaviorQueryFallbackInfo: + type: object + properties: + pinnedDeploymentVersion: + allOf: + - $ref: '#/components/schemas/WorkerDeploymentVersion' + description: The Deployment Version on which the Query was scheduled to be executed on. + fallbackDeploymentVersion: + allOf: + - $ref: '#/components/schemas/WorkerDeploymentVersion' + description: The Deployment Version on which the Query was executed on. + description: "Used as part of QueryWorkflowResponse to indicate that a Query, of a Pinned workflow execution, fell back and \n was executed by workers of a different version." PluginInfo: type: object properties: @@ -10391,6 +10403,13 @@ components: QueryRejectCondition can used to reject the query if workflow state does not satisfy condition. Default: QUERY_REJECT_CONDITION_NONE. format: enum + pinnedVersioningBehaviorQueryFallback: + enum: + - PINNED_VERSIONING_BEHAVIOR_QUERY_FALLBACK_UNSPECIFIED + - PINNED_VERSIONING_BEHAVIOR_QUERY_FALLBACK_NEXT_PINNED_WITH_POLLERS + type: string + description: Specifies the fallback behavior for Queries sent to Pinned Workflow executions. + format: enum QueryWorkflowResponse: type: object properties: @@ -10398,6 +10417,10 @@ components: $ref: '#/components/schemas/Payloads' queryRejected: $ref: '#/components/schemas/QueryRejected' + pinnedVersioningBehaviorQueryFallbackInfo: + allOf: + - $ref: '#/components/schemas/PinnedVersioningBehaviorQueryFallbackInfo' + description: "Only populated when a Query of a Pinned workflow execution gets executed by workers of a different version \n because the workflow's Pinned Version was Drained and had no available pollers." RampByPercentage: type: object properties: diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index 06932adb9..7f7caf8bb 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -301,4 +301,13 @@ message InheritedAutoUpgradeInfo { temporal.api.deployment.v1.WorkerDeploymentVersion source_deployment_version = 1; // The revision number of the source deployment version of the parent/previous workflow. int64 source_deployment_revision_number = 2; -} \ No newline at end of file +} + +// Used as part of QueryWorkflowResponse to indicate that a Query, of a Pinned workflow execution, fell back and +// was executed by workers of a different version. +message PinnedVersioningBehaviorQueryFallbackInfo { + // The Deployment Version on which the Query was scheduled to be executed on. + temporal.api.deployment.v1.WorkerDeploymentVersion pinned_deployment_version = 1; + // The Deployment Version on which the Query was executed on. + temporal.api.deployment.v1.WorkerDeploymentVersion fallback_deployment_version = 2; + } \ No newline at end of file diff --git a/temporal/api/enums/v1/deployment.proto b/temporal/api/enums/v1/deployment.proto index 710d7c38d..bd3111b58 100644 --- a/temporal/api/enums/v1/deployment.proto +++ b/temporal/api/enums/v1/deployment.proto @@ -98,3 +98,12 @@ enum WorkerDeploymentVersionStatus { // workflows are closed, they should decommission the version after it has been drained for that duration. WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED = 5; } + +// Specifies the fallback behavior for Queries, of a Pinned workflow execution, that are sent to a Drained and poller less version. +enum PinnedVersioningBehaviorQueryFallback { + // This is the default behavior. Queries will not fallback to any other version by default. + PINNED_VERSIONING_BEHAVIOR_QUERY_FALLBACK_UNSPECIFIED = 0; + // The Query will be sent to the next Pinned Version that has pollers. + // If no such version exists, the Query will return an error. + PINNED_VERSIONING_BEHAVIOR_QUERY_FALLBACK_NEXT_PINNED_WITH_POLLERS = 1; +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 69b673c81..d8fded206 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1016,11 +1016,18 @@ message QueryWorkflowRequest { // QueryRejectCondition can used to reject the query if workflow state does not satisfy condition. // Default: QUERY_REJECT_CONDITION_NONE. temporal.api.enums.v1.QueryRejectCondition query_reject_condition = 4; + + // Specifies the fallback behavior for Queries sent to Pinned Workflow executions. + temporal.api.enums.v1.PinnedVersioningBehaviorQueryFallback pinned_versioning_behavior_query_fallback = 5; } + message QueryWorkflowResponse { temporal.api.common.v1.Payloads query_result = 1; temporal.api.query.v1.QueryRejected query_rejected = 2; + // Only populated when a Query of a Pinned workflow execution gets executed by workers of a different version + // because the workflow's Pinned Version was Drained and had no available pollers. + temporal.api.deployment.v1.PinnedVersioningBehaviorQueryFallbackInfo pinned_versioning_behavior_query_fallback_info = 3; } message DescribeWorkflowExecutionRequest {