Skip to content

Commit a491abe

Browse files
committed
store source versioning info in ExecutionInfo.VersioningInfo so that pinned version of a tree/chain can be inherited on retry
1 parent 5a21b4a commit a491abe

File tree

4 files changed

+62
-37
lines changed

4 files changed

+62
-37
lines changed

openapi/openapiv2.json

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7174,17 +7174,6 @@
71747174
},
71757175
"description": "RequestIdReference is a indirect reference to a history event through the request ID."
71767176
},
7177-
"WorkflowExecutionStartedEventAttributesSourceWorkflowVersioningInfo": {
7178-
"type": "object",
7179-
"properties": {
7180-
"deploymentVersion": {
7181-
"$ref": "#/definitions/v1WorkerDeploymentVersion"
7182-
},
7183-
"behavior": {
7184-
"$ref": "#/definitions/v1VersioningBehavior"
7185-
}
7186-
}
7187-
},
71887177
"WorkflowRuleActionActionActivityPause": {
71897178
"type": "object"
71907179
},
@@ -13657,6 +13646,17 @@
1365713646
"v1SignalWorkflowExecutionResponse": {
1365813647
"type": "object"
1365913648
},
13649+
"v1SourceWorkflowVersioningInfo": {
13650+
"type": "object",
13651+
"properties": {
13652+
"deploymentVersion": {
13653+
"$ref": "#/definitions/v1WorkerDeploymentVersion"
13654+
},
13655+
"behavior": {
13656+
"$ref": "#/definitions/v1VersioningBehavior"
13657+
}
13658+
}
13659+
},
1366013660
"v1StartBatchOperationResponse": {
1366113661
"type": "object"
1366213662
},
@@ -15571,12 +15571,12 @@
1557115571
"title": "Priority metadata"
1557215572
},
1557315573
"parentVersioningInfo": {
15574-
"$ref": "#/definitions/WorkflowExecutionStartedEventAttributesSourceWorkflowVersioningInfo",
15574+
"$ref": "#/definitions/v1SourceWorkflowVersioningInfo",
1557515575
"description": "When present, this is a child workflow of a versioned parent.\nIf the parent's effective behavior is PINNED, and the child's Task Queue belongs to the\nparent's Version, the child workflow will inherit the parent's Version."
1557615576
},
1557715577
"previousRunVersioningInfo": {
15578-
"$ref": "#/definitions/WorkflowExecutionStartedEventAttributesSourceWorkflowVersioningInfo",
15579-
"description": "When present, this workflow is part of a chain, and the previous workflow in the chain was versioned.\nThe `initiator` field of this event specifies why this new workflow was initiated.\n\nIf initiated by a workflow ContinueAsNew, and the previous workflow's effective behavior is PINNED,\nand the new workflow's Task Queue belongs to the previous workflow's Version, the new workflow will\ninherit the previous workflow's version.\n\nIf initiated by a workflow retry or Cron, the new workflow will never inherit the previous workflow's Version."
15578+
"$ref": "#/definitions/v1SourceWorkflowVersioningInfo",
15579+
"description": "When present, this workflow is part of a chain, and the previous workflow in the chain was versioned.\nThe `initiator` field of this event specifies why this new workflow was initiated.\n\nIf initiated by a workflow ContinueAsNew, and the previous workflow's effective behavior is PINNED,\nand the new workflow's Task Queue belongs to the previous workflow's Version, the new workflow will\ninherit the previous workflow's version.\n\nIf initiated by a workflow retry on a root workflow execution, the new workflow will not inherit the\nprevious workflow's Version, but, if the previous workflow has a Pinned parent or is part of a Pinned\nContinueAsNew chain, then the new workflow will inherit the version of the existing tree or chain.\n\nIf initiated by a workflow Cron, the new workflow will never inherit the previous workflow's Version."
1558015580
}
1558115581
},
1558215582
"title": "Always the first event in workflow history"
@@ -15733,6 +15733,10 @@
1573315733
"versionTransition": {
1573415734
"$ref": "#/definitions/v1DeploymentVersionTransition",
1573515735
"description": "When present, indicates the workflow is transitioning to a different deployment version\n(which may belong to the same deployment name or another). Can indicate one of the following\ntransitions: unversioned -> versioned, versioned -> versioned\non a different deployment version, or versioned -> unversioned.\nNot applicable to workflows with PINNED behavior.\nWhen a workflow with AUTO_UPGRADE behavior creates a new workflow task, it will automatically\nstart a transition to the task queue's current version if the task queue's current version is\ndifferent from the workflow's current deployment version.\nIf the AUTO_UPGRADE workflow is stuck due to backlogged activity or workflow tasks, those\ntasks will be redirected to the task queue's current version. As soon as a poller from\nthat deployment version is available to receive the task, the workflow will automatically\nstart a transition to that version and continue execution there.\nA version transition can only exist while there is a pending or started workflow task.\nOnce the pending workflow task completes on the transition's target version, the\ntransition completes and the workflow's `behavior`, and `deployment_version` fields are updated per the\nworker's task completion response.\nPending activities will not start new attempts during a transition. Once the transition is\ncompleted, pending activities will start their next attempt on the new version."
15736+
},
15737+
"sourceWorkflowVersioningInfo": {
15738+
"$ref": "#/definitions/v1SourceWorkflowVersioningInfo",
15739+
"description": "When present, this workflow execution is the child of a versioned parent, or is part of\na ContinueAsNew chain and the previous workflow in the chain was versioned.\nIf this workflow retries and the source is PINNED, the new retry workflow will inherit the\nVersion of the source workflow."
1573615740
}
1573715741
},
1573815742
"description": "Holds all the information about worker versioning for a particular workflow execution.\nExperimental. Versioning info is experimental and might change in the future."

openapi/openapiv3.yaml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10927,6 +10927,18 @@ components:
1092710927
SignalWorkflowExecutionResponse:
1092810928
type: object
1092910929
properties: {}
10930+
SourceWorkflowVersioningInfo:
10931+
type: object
10932+
properties:
10933+
deploymentVersion:
10934+
$ref: '#/components/schemas/WorkerDeploymentVersion'
10935+
behavior:
10936+
enum:
10937+
- VERSIONING_BEHAVIOR_UNSPECIFIED
10938+
- VERSIONING_BEHAVIOR_PINNED
10939+
- VERSIONING_BEHAVIOR_AUTO_UPGRADE
10940+
type: string
10941+
format: enum
1093010942
StartBatchOperationRequest:
1093110943
type: object
1093210944
properties:
@@ -13093,14 +13105,14 @@ components:
1309313105
description: Priority metadata
1309413106
parentVersioningInfo:
1309513107
allOf:
13096-
- $ref: '#/components/schemas/WorkflowExecutionStartedEventAttributes_SourceWorkflowVersioningInfo'
13108+
- $ref: '#/components/schemas/SourceWorkflowVersioningInfo'
1309713109
description: |-
1309813110
When present, this is a child workflow of a versioned parent.
1309913111
If the parent's effective behavior is PINNED, and the child's Task Queue belongs to the
1310013112
parent's Version, the child workflow will inherit the parent's Version.
1310113113
previousRunVersioningInfo:
1310213114
allOf:
13103-
- $ref: '#/components/schemas/WorkflowExecutionStartedEventAttributes_SourceWorkflowVersioningInfo'
13115+
- $ref: '#/components/schemas/SourceWorkflowVersioningInfo'
1310413116
description: |-
1310513117
When present, this workflow is part of a chain, and the previous workflow in the chain was versioned.
1310613118
The `initiator` field of this event specifies why this new workflow was initiated.
@@ -13109,20 +13121,12 @@ components:
1310913121
and the new workflow's Task Queue belongs to the previous workflow's Version, the new workflow will
1311013122
inherit the previous workflow's version.
1311113123

13112-
If initiated by a workflow retry or Cron, the new workflow will never inherit the previous workflow's Version.
13124+
If initiated by a workflow retry on a root workflow execution, the new workflow will not inherit the
13125+
previous workflow's Version, but, if the previous workflow has a Pinned parent or is part of a Pinned
13126+
ContinueAsNew chain, then the new workflow will inherit the version of the existing tree or chain.
13127+
13128+
If initiated by a workflow Cron, the new workflow will never inherit the previous workflow's Version.
1311313129
description: Always the first event in workflow history
13114-
WorkflowExecutionStartedEventAttributes_SourceWorkflowVersioningInfo:
13115-
type: object
13116-
properties:
13117-
deploymentVersion:
13118-
$ref: '#/components/schemas/WorkerDeploymentVersion'
13119-
behavior:
13120-
enum:
13121-
- VERSIONING_BEHAVIOR_UNSPECIFIED
13122-
- VERSIONING_BEHAVIOR_PINNED
13123-
- VERSIONING_BEHAVIOR_AUTO_UPGRADE
13124-
type: string
13125-
format: enum
1312613130
WorkflowExecutionTerminatedEventAttributes:
1312713131
type: object
1312813132
properties:
@@ -13328,6 +13332,14 @@ components:
1332813332
worker's task completion response.
1332913333
Pending activities will not start new attempts during a transition. Once the transition is
1333013334
completed, pending activities will start their next attempt on the new version.
13335+
sourceWorkflowVersioningInfo:
13336+
allOf:
13337+
- $ref: '#/components/schemas/SourceWorkflowVersioningInfo'
13338+
description: |-
13339+
When present, this workflow execution is the child of a versioned parent, or is part of
13340+
a ContinueAsNew chain and the previous workflow in the chain was versioned.
13341+
If this workflow retries and the source is PINNED, the new retry workflow will inherit the
13342+
Version of the source workflow.
1333113343
description: |-
1333213344
Holds all the information about worker versioning for a particular workflow execution.
1333313345
Experimental. Versioning info is experimental and might change in the future.

temporal/api/history/v1/message.proto

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ message WorkflowExecutionStartedEventAttributes {
142142
// When present, this is a child workflow of a versioned parent.
143143
// If the parent's effective behavior is PINNED, and the child's Task Queue belongs to the
144144
// parent's Version, the child workflow will inherit the parent's Version.
145-
SourceWorkflowVersioningInfo parent_versioning_info = 37;
145+
temporal.api.workflow.v1.SourceWorkflowVersioningInfo parent_versioning_info = 37;
146146

147147
// When present, this workflow is part of a chain, and the previous workflow in the chain was versioned.
148148
// The `initiator` field of this event specifies why this new workflow was initiated.
@@ -151,13 +151,12 @@ message WorkflowExecutionStartedEventAttributes {
151151
// and the new workflow's Task Queue belongs to the previous workflow's Version, the new workflow will
152152
// inherit the previous workflow's version.
153153
//
154-
// If initiated by a workflow retry or Cron, the new workflow will never inherit the previous workflow's Version.
155-
SourceWorkflowVersioningInfo previous_run_versioning_info = 38;
156-
}
157-
158-
message SourceWorkflowVersioningInfo {
159-
temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 1;
160-
temporal.api.enums.v1.VersioningBehavior behavior = 2;
154+
// If initiated by a workflow retry on a root workflow execution, the new workflow will not inherit the
155+
// previous workflow's Version, but, if the previous workflow has a Pinned parent or is part of a Pinned
156+
// ContinueAsNew chain, then the new workflow will inherit the version of the existing tree or chain.
157+
//
158+
// If initiated by a workflow Cron, the new workflow will never inherit the previous workflow's Version.
159+
temporal.api.workflow.v1.SourceWorkflowVersioningInfo previous_run_versioning_info = 38;
161160
}
162161
}
163162

temporal/api/workflow/v1/message.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,16 @@ message WorkflowExecutionVersioningInfo {
207207
// Pending activities will not start new attempts during a transition. Once the transition is
208208
// completed, pending activities will start their next attempt on the new version.
209209
DeploymentVersionTransition version_transition = 6;
210+
// When present, this workflow execution is the child of a versioned parent, or is part of
211+
// a ContinueAsNew chain and the previous workflow in the chain was versioned.
212+
// If this workflow retries and the source is PINNED, the new retry workflow will inherit the
213+
// Version of the source workflow.
214+
SourceWorkflowVersioningInfo source_workflow_versioning_info = 8;
215+
}
216+
217+
message SourceWorkflowVersioningInfo {
218+
temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 1;
219+
temporal.api.enums.v1.VersioningBehavior behavior = 2;
210220
}
211221

212222
// Holds information about ongoing transition of a workflow execution from one deployment to another.

0 commit comments

Comments
 (0)