Skip to content

Commit de624ee

Browse files
authored
Add LastCurrentTime to version info to tell if it ever became current (#692)
_**READ BEFORE MERGING:** All PRs require approval by both Server AND SDK teams before merging! This is why the number of required approvals is "2" and not "1"--two reviewers from the same team is NOT sufficient. If your PR is not approved by someone in BOTH teams, it may be summarily reverted._ <!-- Describe what has changed in this PR --> **What changed?** Add LastCurrentTime to version info to tell if it ever became current <!-- Tell your future self why have you made these changes --> **Why?** So that the controller can accelerate rollout if it detects that the target version was previously Current (aka it's actually a roll back) <!-- Are there any breaking changes on binary or code level? --> **Breaking changes** None <!-- If this breaks the Server, please provide the Server PR to merge right after this PR was merged. --> Doesn't break server, but here's the server PR: temporalio/temporal#8845
1 parent 1a1e74e commit de624ee

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

openapi/openapiv2.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8639,10 +8639,15 @@
86398639
"format": "date-time",
86408640
"description": "Timestamp when this version first became current or ramping."
86418641
},
8642+
"lastCurrentTime": {
8643+
"type": "string",
8644+
"format": "date-time",
8645+
"description": "Timestamp when this version last became current.\nCan be used to determine whether a version has ever been Current."
8646+
},
86428647
"lastDeactivationTime": {
86438648
"type": "string",
86448649
"format": "date-time",
8645-
"description": "Timestamp when this version last stopped being current or ramping."
8650+
"description": "Timestamp when this version last stopped being current or ramping.\nCleared if the version becomes current or ramping again."
86468651
}
86478652
}
86488653
},
@@ -17541,10 +17546,15 @@
1754117546
"format": "date-time",
1754217547
"description": "Timestamp when this version first became current or ramping."
1754317548
},
17549+
"lastCurrentTime": {
17550+
"type": "string",
17551+
"format": "date-time",
17552+
"description": "Timestamp when this version last became current.\nCan be used to determine whether a version has ever been Current."
17553+
},
1754417554
"lastDeactivationTime": {
1754517555
"type": "string",
1754617556
"format": "date-time",
17547-
"description": "Timestamp when this version last stopped being current or ramping."
17557+
"description": "Timestamp when this version last stopped being current or ramping.\nCleared if the version becomes current or ramping again."
1754817558
},
1754917559
"rampPercentage": {
1755017560
"type": "number",

openapi/openapiv3.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14738,9 +14738,17 @@ components:
1473814738
type: string
1473914739
description: Timestamp when this version first became current or ramping.
1474014740
format: date-time
14741+
lastCurrentTime:
14742+
type: string
14743+
description: |-
14744+
Timestamp when this version last became current.
14745+
Can be used to determine whether a version has ever been Current.
14746+
format: date-time
1474114747
lastDeactivationTime:
1474214748
type: string
14743-
description: Timestamp when this version last stopped being current or ramping.
14749+
description: |-
14750+
Timestamp when this version last stopped being current or ramping.
14751+
Cleared if the version becomes current or ramping again.
1474414752
format: date-time
1474514753
WorkerDeploymentOptions:
1474614754
type: object
@@ -14834,9 +14842,17 @@ components:
1483414842
type: string
1483514843
description: Timestamp when this version first became current or ramping.
1483614844
format: date-time
14845+
lastCurrentTime:
14846+
type: string
14847+
description: |-
14848+
Timestamp when this version last became current.
14849+
Can be used to determine whether a version has ever been Current.
14850+
format: date-time
1483714851
lastDeactivationTime:
1483814852
type: string
14839-
description: Timestamp when this version last stopped being current or ramping.
14853+
description: |-
14854+
Timestamp when this version last stopped being current or ramping.
14855+
Cleared if the version becomes current or ramping again.
1484014856
format: date-time
1484114857
rampPercentage:
1484214858
type: number

temporal/api/deployment/v1/message.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,13 @@ message WorkerDeploymentVersionInfo {
120120

121121
// Timestamp when this version first became current or ramping.
122122
google.protobuf.Timestamp first_activation_time = 12;
123+
124+
// Timestamp when this version last became current.
125+
// Can be used to determine whether a version has ever been Current.
126+
google.protobuf.Timestamp last_current_time = 15;
127+
123128
// Timestamp when this version last stopped being current or ramping.
129+
// Cleared if the version becomes current or ramping again.
124130
google.protobuf.Timestamp last_deactivation_time = 13;
125131

126132
// Range: [0, 100]. Must be zero if the version is not ramping (i.e. `ramping_since_time` is nil).
@@ -232,7 +238,11 @@ message WorkerDeploymentInfo {
232238
google.protobuf.Timestamp routing_update_time = 8;
233239
// Timestamp when this version first became current or ramping.
234240
google.protobuf.Timestamp first_activation_time = 9;
241+
// Timestamp when this version last became current.
242+
// Can be used to determine whether a version has ever been Current.
243+
google.protobuf.Timestamp last_current_time = 12;
235244
// Timestamp when this version last stopped being current or ramping.
245+
// Cleared if the version becomes current or ramping again.
236246
google.protobuf.Timestamp last_deactivation_time = 10;
237247
}
238248
}

0 commit comments

Comments
 (0)