Skip to content

Commit d5c4829

Browse files
committed
rename and remove stop reason
1 parent 93cbc95 commit d5c4829

8 files changed

Lines changed: 171 additions & 207 deletions

File tree

api/persistence/v1/executions.pb.go

Lines changed: 144 additions & 158 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ require (
6666
go.opentelemetry.io/otel/sdk v1.43.0
6767
go.opentelemetry.io/otel/sdk/metric v1.43.0
6868
go.opentelemetry.io/otel/trace v1.44.0
69-
go.temporal.io/api v1.63.4-0.20260723223619-864714b47375
69+
go.temporal.io/api v1.63.4-0.20260723233445-8c30a7d77076
7070
go.temporal.io/auto-scaled-workers v0.0.0-20260706201056-4320b34799ee
7171
go.temporal.io/sdk v1.41.1
7272
go.uber.org/fx v1.24.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,8 @@ go.temporal.io/api v1.63.4-0.20260722170540-d887973f0ebc h1:u6NNX5K5XdLqUbbruFMq
483483
go.temporal.io/api v1.63.4-0.20260722170540-d887973f0ebc/go.mod h1:SrlW2JMwVlDP4nRWSNznUFqnSHd+YeMDS1BkYo63HCQ=
484484
go.temporal.io/api v1.63.4-0.20260723223619-864714b47375 h1:5vDQEcw7PwikqfX9DdYOig7/9XoxQ1dgqj3L9Pr4TK0=
485485
go.temporal.io/api v1.63.4-0.20260723223619-864714b47375/go.mod h1:SrlW2JMwVlDP4nRWSNznUFqnSHd+YeMDS1BkYo63HCQ=
486+
go.temporal.io/api v1.63.4-0.20260723233445-8c30a7d77076 h1:cNdopy1sVIINkLFeR7DZfcYmzYNuxLMm9bhwLFNIplE=
487+
go.temporal.io/api v1.63.4-0.20260723233445-8c30a7d77076/go.mod h1:SrlW2JMwVlDP4nRWSNznUFqnSHd+YeMDS1BkYo63HCQ=
486488
go.temporal.io/auto-scaled-workers v0.0.0-20260706201056-4320b34799ee h1:y6A65Iml06cR3CpxW2Zn8FQLjniPDTnN4jtr69UZxXI=
487489
go.temporal.io/auto-scaled-workers v0.0.0-20260706201056-4320b34799ee/go.mod h1:hhHijO9XRPIkAflLJJHix61M9FzbRPqk8fSydkcLkqw=
488490
go.temporal.io/sdk v1.41.1 h1:yOpvsHyDD1lNuwlGBv/SUodCPhjv9nDeC9lLHW/fJUA=

proto/internal/temporal/server/api/persistence/v1/executions.proto

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,6 @@ message TimeSkippingInfo {
342342
// Tracks the number of times a time-skipping transition has occurred since time skipping
343343
// was most recently enabled. It is reset every time the skipping config is updated.
344344
int32 session_skip_count = 6;
345-
346-
// Why time skipping most recently stopped running. Set when skipping transitions from running to
347-
// stopped (user disabled it, a fast-forward completed, or the per-session skip cap was reached).
348-
temporal.api.enums.v1.TimeSkippingStopReason stop_reason = 7;
349345
}
350346

351347
message FastForwardInfo {

service/frontend/workflow_handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,9 +714,9 @@ func (wh *WorkflowHandler) validateAndPopulateTimeSkippingConfig(
714714
ns.String(),
715715
)
716716
}
717-
if tsc.GetMaxSkipPerSession() <= 0 {
717+
if tsc.GetMaxSessionSkipCount() <= 0 {
718718
defaultMaxSkipPerSession := wh.config.WorkflowTimeSkippingMaxSkipPerSession(ns.String())
719-
tsc.MaxSkipPerSession = max(1, int32(defaultMaxSkipPerSession))
719+
tsc.MaxSessionSkipCount = max(1, int32(defaultMaxSkipPerSession))
720720
}
721721

722722
if !tsc.GetEnabled() {

service/frontend/workflow_handler_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3724,17 +3724,17 @@ func (s *WorkflowHandlerSuite) TestValidateTimeSkippingConfig() {
37243724
// namespace with a per-namespace override uses that value
37253725
tsc := &commonpb.TimeSkippingConfig{Enabled: true}
37263726
s.Require().NoError(maxSkipWH.validateAndPopulateTimeSkippingConfig(tsc, s.testNamespace))
3727-
s.Require().Equal(int32(7), tsc.GetMaxSkipPerSession())
3727+
s.Require().Equal(int32(7), tsc.GetMaxSessionSkipCount())
37283728

37293729
// namespace without a per-namespace setting falls back to the per-cell value
37303730
tsc = &commonpb.TimeSkippingConfig{Enabled: true}
37313731
s.Require().NoError(maxSkipWH.validateAndPopulateTimeSkippingConfig(tsc, namespace.Name(otherNamespace)))
3732-
s.Require().Equal(int32(42), tsc.GetMaxSkipPerSession())
3732+
s.Require().Equal(int32(42), tsc.GetMaxSessionSkipCount())
37333733

37343734
// a value already on the request is preserved, not overwritten by dynamic config
3735-
tsc = &commonpb.TimeSkippingConfig{Enabled: true, MaxSkipPerSession: 999}
3735+
tsc = &commonpb.TimeSkippingConfig{Enabled: true, MaxSessionSkipCount: 999}
37363736
s.Require().NoError(maxSkipWH.validateAndPopulateTimeSkippingConfig(tsc, s.testNamespace))
3737-
s.Require().Equal(int32(999), tsc.GetMaxSkipPerSession())
3737+
s.Require().Equal(int32(999), tsc.GetMaxSessionSkipCount())
37383738
}
37393739

37403740
// TestExecuteMultiOperation_TimeSkipping_DCDisabled verifies that when the DC gate is off,

service/history/workflow/timeskipping.go

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"time"
77

88
commonpb "go.temporal.io/api/common/v1"
9-
enumspb "go.temporal.io/api/enums/v1"
109
historypb "go.temporal.io/api/history/v1"
1110
"go.temporal.io/api/serviceerror"
1211
persistencespb "go.temporal.io/server/api/persistence/v1"
@@ -54,9 +53,6 @@ func (ms *MutableStateImpl) updateTimeSkippingInfo(
5453
return
5554
}
5655
ms.executionInfo.TimeSkippingInfo.Config = config
57-
if !config.GetEnabled() {
58-
tsi.StopReason = enumspb.TIME_SKIPPING_STOP_REASON_USER_DISABLED
59-
}
6056
ms.applyFastForward(nil)
6157
ms.timeSkippingInfoUpdated = true
6258
tsi.SessionSkipCount = 0
@@ -191,8 +187,8 @@ func propagateTimeSkippingToChild(
191187

192188
// propagate both config and state
193189
return &commonpb.TimeSkippingConfig{
194-
Enabled: true,
195-
MaxSkipPerSession: tsc.GetMaxSkipPerSession(),
190+
Enabled: true,
191+
MaxSessionSkipCount: tsc.GetMaxSessionSkipCount(),
196192
}, stateProp
197193
}
198194

@@ -338,7 +334,7 @@ func (util *TimeSkippingInfoUtil) IsRunning(now time.Time) bool {
338334
if util == nil || util.tsi == nil {
339335
return false
340336
}
341-
hasSkipQuota := util.tsi.Config.GetMaxSkipPerSession() > util.tsi.GetSessionSkipCount()
337+
hasSkipQuota := util.tsi.Config.GetMaxSessionSkipCount() > util.tsi.GetSessionSkipCount()
342338
if !hasSkipQuota {
343339
return false
344340
}
@@ -361,7 +357,6 @@ func (util *TimeSkippingInfoUtil) ToDescribeInfo(currentTime time.Time) *commonp
361357
CurrentTime: timestamppb.New(currentTime),
362358
IsRunning: util.IsRunning(currentTime),
363359
FastForwardInfo: util.ToFastForwardInfo(),
364-
StopReason: util.tsi.GetStopReason(),
365360
}
366361
}
367362

@@ -586,13 +581,11 @@ func (ms *MutableStateImpl) ApplyWorkflowExecutionTimeSkippingTransitionedEvent(
586581
if attr.GetDisabledAfterFastForward() && tsi.GetFastForwardInfo() != nil {
587582
tsi.GetFastForwardInfo().HasReached = true
588583
tsi.Config.Enabled = false
589-
tsi.StopReason = enumspb.TIME_SKIPPING_STOP_REASON_FAST_FORWARD_COMPLETED
590584
}
591585
// update skip
592586
tsi.SessionSkipCount += 1
593-
if tsi.SessionSkipCount >= tsi.Config.GetMaxSkipPerSession() && tsi.Config.Enabled {
587+
if tsi.SessionSkipCount >= tsi.Config.GetMaxSessionSkipCount() && tsi.Config.Enabled {
594588
tsi.Config.Enabled = false
595-
tsi.StopReason = enumspb.TIME_SKIPPING_STOP_REASON_MAX_SKIP_PER_SESSION_REACHED
596589
}
597590

598591
ms.timeSkippingInfoUpdated = true

service/history/workflow/timeskipping_test.go

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -152,35 +152,35 @@ func (s *mutableStateSuite) TestPropagateTimeSkippingToNextRun_FastForwardInfo()
152152
s.Run("SkipCountAloneStillPropagates", func() {
153153
tsc, stateProp := propagateTimeSkippingToNextRun(&persistencespb.WorkflowExecutionInfo{
154154
TimeSkippingInfo: &persistencespb.TimeSkippingInfo{
155-
Config: &commonpb.TimeSkippingConfig{Enabled: true, MaxSkipPerSession: 50},
155+
Config: &commonpb.TimeSkippingConfig{Enabled: true, MaxSessionSkipCount: 50},
156156
SessionSkipCount: 2,
157157
},
158158
})
159159
s.Require().NotNil(tsc)
160160
s.Require().NotNil(stateProp)
161161
s.Nil(stateProp.GetInitialSkippedDuration())
162162
s.Equal(int32(2), stateProp.GetInitialSkipCount())
163-
s.Equal(int32(50), tsc.MaxSkipPerSession)
163+
s.Equal(int32(50), tsc.MaxSessionSkipCount)
164164
})
165165

166166
s.Run("FullPropagationOfAllTimeSippingStates", func() {
167167
tsc, stateProp := propagateTimeSkippingToNextRun(&persistencespb.WorkflowExecutionInfo{
168168
TimeSkippingInfo: &persistencespb.TimeSkippingInfo{
169-
Config: &commonpb.TimeSkippingConfig{Enabled: true, MaxSkipPerSession: 50},
169+
Config: &commonpb.TimeSkippingConfig{Enabled: true, MaxSessionSkipCount: 50},
170170
AccumulatedSkippedDuration: durationpb.New(time.Hour),
171171
SessionSkipCount: 3,
172172
},
173173
})
174174
s.Require().NotNil(tsc)
175-
s.Equal(int32(50), tsc.GetMaxSkipPerSession())
175+
s.Equal(int32(50), tsc.GetMaxSessionSkipCount())
176176
s.Require().NotNil(stateProp)
177177
s.Equal(int32(3), stateProp.GetInitialSkipCount())
178178
})
179179

180180
s.Run("SessionSkipCountPropagatesEvenWhenDisabled", func() {
181181
tsc, stateProp := propagateTimeSkippingToNextRun(&persistencespb.WorkflowExecutionInfo{
182182
TimeSkippingInfo: &persistencespb.TimeSkippingInfo{
183-
Config: &commonpb.TimeSkippingConfig{Enabled: false, MaxSkipPerSession: 50},
183+
Config: &commonpb.TimeSkippingConfig{Enabled: false, MaxSessionSkipCount: 50},
184184
AccumulatedSkippedDuration: durationpb.New(time.Hour),
185185
SessionSkipCount: 3,
186186
},
@@ -215,9 +215,9 @@ func (s *mutableStateSuite) TestSnapshotTimeSkippingInfo_ForChildWorkflows() {
215215
return &persistencespb.WorkflowExecutionInfo{
216216
TimeSkippingInfo: &persistencespb.TimeSkippingInfo{
217217
Config: &commonpb.TimeSkippingConfig{
218-
Enabled: true,
219-
FastForward: durationpb.New(3 * time.Hour),
220-
MaxSkipPerSession: sessionMaxSkipCount,
218+
Enabled: true,
219+
FastForward: durationpb.New(3 * time.Hour),
220+
MaxSessionSkipCount: sessionMaxSkipCount,
221221
},
222222
AccumulatedSkippedDuration: durationpb.New(accumSkip),
223223
SessionSkipCount: 3,
@@ -245,7 +245,7 @@ func (s *mutableStateSuite) TestSnapshotTimeSkippingInfo_ForChildWorkflows() {
245245
// has virtual time
246246
s.Equal(accumSkip, propagatedState.GetInitialSkippedDuration().AsDuration())
247247
// has config of max skip
248-
s.Equal(sessionMaxSkipCount, tsc.GetMaxSkipPerSession())
248+
s.Equal(sessionMaxSkipCount, tsc.GetMaxSessionSkipCount())
249249
// no accumulated session skip
250250
s.Equal(int32(0), propagatedState.GetInitialSkipCount())
251251
})
@@ -463,7 +463,6 @@ func (s *mutableStateSuite) TestInitTimeSkippingInfo() {
463463
s.Require().NotNil(tsi)
464464
s.True(proto.Equal(cfg, tsi.GetConfig()))
465465
s.Require().NotNil(tsi.GetFastForwardInfo())
466-
s.Require().Equal(enumspb.TIME_SKIPPING_STOP_REASON_UNSPECIFIED, tsi.GetStopReason())
467466
s.Require().Nil(tsi.GetAccumulatedSkippedDuration())
468467
// timestamppb translates to UTC time
469468
s.Require().Equal(baseTime.Add(3*time.Hour).UTC(),
@@ -517,7 +516,6 @@ func (s *mutableStateSuite) TestInitTimeSkippingInfo() {
517516
s.Nil(tsi.GetConfig())
518517
s.Equal(hasSkipped, tsi.GetAccumulatedSkippedDuration().AsDuration())
519518
s.Equal(baseTime.Add(hasSkipped), s.mutableState.Now(), "inherited skip still shifts the virtual clock")
520-
s.Equal(enumspb.TIME_SKIPPING_STOP_REASON_UNSPECIFIED, tsi.GetStopReason())
521519
})
522520

523521
s.Run("SessionSkipCountSeededFromPropagation", func() {
@@ -596,7 +594,6 @@ func (s *mutableStateSuite) TestUpdateTimeSkippingInfo() {
596594
Enabled: false,
597595
},
598596
AccumulatedSkippedDuration: durationpb.New(time.Hour),
599-
StopReason: enumspb.TIME_SKIPPING_STOP_REASON_USER_DISABLED,
600597
}
601598
s.mutableState.executionInfo.TimeSkippingInfo = &currentTSI
602599

@@ -611,7 +608,6 @@ func (s *mutableStateSuite) TestUpdateTimeSkippingInfo() {
611608

612609
s.Require().NotNil(newTSI)
613610
s.True(proto.Equal(newConfig, newTSI.GetConfig()))
614-
s.Equal(enumspb.TIME_SKIPPING_STOP_REASON_UNSPECIFIED, newTSI.GetStopReason(), "re-enabling clears the prior stop reason")
615611
s.Require().NotNil(newTSI.GetFastForwardInfo())
616612
// re-installing the fast-forward records the current versioned transition, so a task
617613
// emitted here validates against a stable reference after a failover.
@@ -668,8 +664,6 @@ func (s *mutableStateSuite) TestUpdateTimeSkippingInfo() {
668664
s.True(proto.Equal(tsc3, tsc3TSI.GetConfig()))
669665
s.Nil(tsc3TSI.GetFastForwardInfo())
670666
s.Equal(time.Hour, tsc3TSI.GetAccumulatedSkippedDuration().AsDuration())
671-
s.Equal(enumspb.TIME_SKIPPING_STOP_REASON_USER_DISABLED, tsc3TSI.GetStopReason())
672-
673667
})
674668

675669
// Updating the config restarts the skip session: the per-session skip counter from the
@@ -678,13 +672,13 @@ func (s *mutableStateSuite) TestUpdateTimeSkippingInfo() {
678672
s.mutableState.timeSource = clock.NewEventTimeSource()
679673
s.mutableState.executionInfo.TimeSkippingInfo = &persistencespb.TimeSkippingInfo{
680674
Config: &commonpb.TimeSkippingConfig{
681-
Enabled: false,
682-
MaxSkipPerSession: 10,
675+
Enabled: false,
676+
MaxSessionSkipCount: 10,
683677
},
684678
SessionSkipCount: 7,
685679
}
686680

687-
s.mutableState.updateTimeSkippingInfo(&commonpb.TimeSkippingConfig{Enabled: true, MaxSkipPerSession: 10})
681+
s.mutableState.updateTimeSkippingInfo(&commonpb.TimeSkippingConfig{Enabled: true, MaxSessionSkipCount: 10})
688682

689683
tsi := s.mutableState.executionInfo.GetTimeSkippingInfo()
690684
s.Require().NotNil(tsi)
@@ -1417,16 +1411,15 @@ func (s *mutableStateSuite) TestApplyWorkflowExecutionTimeSkippingTransitionedEv
14171411
tsi := s.mutableState.GetExecutionInfo().TimeSkippingInfo
14181412
s.Require().False(tsi.GetConfig().GetEnabled())
14191413
s.Require().True(tsi.GetFastForwardInfo().GetHasReached())
1420-
s.Require().Equal(enumspb.TIME_SKIPPING_STOP_REASON_FAST_FORWARD_COMPLETED, tsi.GetStopReason())
14211414
})
14221415

14231416
// Every applied transition increments SessionSkipCount by one, and once the count reaches
14241417
// the per-session cap the config is disabled.
14251418
s.Run("SessionSkipCountIncrementsUntilCapDisables", func() {
14261419
s.mutableState.executionInfo.TimeSkippingInfo = &persistencespb.TimeSkippingInfo{
14271420
Config: &commonpb.TimeSkippingConfig{
1428-
Enabled: true,
1429-
MaxSkipPerSession: 2,
1421+
Enabled: true,
1422+
MaxSessionSkipCount: 2,
14301423
},
14311424
}
14321425
targetTime := baseTime.Add(time.Hour)
@@ -1440,7 +1433,6 @@ func (s *mutableStateSuite) TestApplyWorkflowExecutionTimeSkippingTransitionedEv
14401433
tsi := s.mutableState.GetExecutionInfo().TimeSkippingInfo
14411434
s.Require().Equal(int32(1), tsi.GetSessionSkipCount())
14421435
s.Require().True(tsi.GetConfig().GetEnabled())
1443-
s.Require().Equal(enumspb.TIME_SKIPPING_STOP_REASON_UNSPECIFIED, tsi.GetStopReason())
14441436

14451437
// second skip: count reaches the cap of 2, disables
14461438
err = s.mutableState.ApplyWorkflowExecutionTimeSkippingTransitionedEvent(
@@ -1450,7 +1442,6 @@ func (s *mutableStateSuite) TestApplyWorkflowExecutionTimeSkippingTransitionedEv
14501442
s.Require().NoError(err)
14511443
s.Require().Equal(int32(2), tsi.GetSessionSkipCount())
14521444
s.Require().False(tsi.GetConfig().GetEnabled())
1453-
s.Require().Equal(enumspb.TIME_SKIPPING_STOP_REASON_MAX_SKIP_PER_SESSION_REACHED, tsi.GetStopReason())
14541445
})
14551446

14561447
// A MaxSkipPerSession of 0 caps on the very first skip (1 >= 0), disabling immediately.
@@ -1471,7 +1462,6 @@ func (s *mutableStateSuite) TestApplyWorkflowExecutionTimeSkippingTransitionedEv
14711462
tsi := s.mutableState.GetExecutionInfo().TimeSkippingInfo
14721463
s.Require().Equal(int32(1), tsi.GetSessionSkipCount())
14731464
s.Require().False(tsi.GetConfig().GetEnabled())
1474-
s.Require().Equal(enumspb.TIME_SKIPPING_STOP_REASON_MAX_SKIP_PER_SESSION_REACHED, tsi.GetStopReason())
14751465
})
14761466
}
14771467

@@ -1683,7 +1673,6 @@ func (s *mutableStateSuite) TestTimeSkippingInfoUtil() {
16831673
s.True(info.GetIsRunning())
16841674
s.Equal(now, info.GetCurrentTime().AsTime())
16851675
s.Nil(info.GetFastForwardInfo(), "no fast-forward set")
1686-
s.Equal(enumspb.TIME_SKIPPING_STOP_REASON_UNSPECIFIED, info.GetStopReason(), "no stop reason while running")
16871676
})
16881677

16891678
s.Run("ToDescribeInfoWithFastForward", func() {
@@ -1712,14 +1701,12 @@ func (s *mutableStateSuite) TestTimeSkippingInfoUtil() {
17121701
util := NewTimeSkippingInfoUtil(&persistencespb.TimeSkippingInfo{
17131702
Config: &commonpb.TimeSkippingConfig{Enabled: false},
17141703
AccumulatedSkippedDuration: durationpb.New(2 * time.Hour),
1715-
StopReason: enumspb.TIME_SKIPPING_STOP_REASON_USER_DISABLED,
17161704
})
17171705
msNow := time.Date(2027, 1, 1, 12, 0, 0, 0, time.UTC)
17181706
info := util.ToDescribeInfo(msNow)
17191707
s.NotNil(info)
17201708
s.False(info.GetIsRunning())
17211709
s.Equal(msNow, info.GetCurrentTime().AsTime())
1722-
s.Equal(enumspb.TIME_SKIPPING_STOP_REASON_USER_DISABLED, info.GetStopReason())
17231710
})
17241711

17251712
}

0 commit comments

Comments
 (0)