Skip to content
Closed
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
31 changes: 31 additions & 0 deletions openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
},
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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."
}
}
},
Expand Down
23 changes: 23 additions & 0 deletions openapi/openapiv3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -10391,13 +10403,24 @@ 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:
queryResult:
$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:
Expand Down
11 changes: 10 additions & 1 deletion temporal/api/deployment/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

// 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;
}
9 changes: 9 additions & 0 deletions temporal/api/enums/v1/deployment.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

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

Pardon my lack of knowledge here, but versions are ordered in the sense there is such thing as an obvious "next" version? And is there no case where you'd want to signal, update, cancel, etc a "next" version in this fallback situation, only query?

Copy link
Contributor

Choose a reason for hiding this comment

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

They're ordered by creation time

// If no such version exists, the Query will return an error.
PINNED_VERSIONING_BEHAVIOR_QUERY_FALLBACK_NEXT_PINNED_WITH_POLLERS = 1;
}
7 changes: 7 additions & 0 deletions temporal/api/workflowservice/v1/request_response.proto
Copy link
Member

@cretz cretz Dec 5, 2025

Choose a reason for hiding this comment

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

Is there a linked server PR for this? I know we add a lot of versioning stuff these days and some of it is deprecated soon thereafter, so just want to confirm we're sure this is what is needed (I admit I don't know much about this versioning subject).

Copy link
Member Author

Choose a reason for hiding this comment

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

I still have not brought it to a stage where I can open a PR - it's very roughly built rn with a bunch of TODO's

I can do my best to wrap it up soon before the API PR closes out so that you can have a peek at it before you approve of this.

Copy link
Member

Choose a reason for hiding this comment

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

👍 IMO no need to merge this until we have code ready to use it (in case we learn something)

Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading