[don't merge] Time-skipping POC for CHASM with SAA#10799
Conversation
d7a4c7d to
feec4da
Compare
| _, err = mutableState.AddWorkflowExecutionTimeSkippingTransitionedEvent( | ||
| ctx, time.Time{}, true) | ||
| if err != nil { | ||
| // Disable time skipping through the archetype-aware sink: workflows record a history event; CHASM |
There was a problem hiding this comment.
not related to this chasm-pr, but have detected a refinement point for the whole project here that this task is also a part of what offers by the history substrate and it only turns off the TS and doesn't need regeneration of timer tasks
472df9c to
4ed50b4
Compare
simiplify the time skipping protocol between framework and component users
4ed50b4 to
390149c
Compare
| // TODO(time-skipping/chasm): emit the fast-forward wake as a ChasmTaskPure on the root component and | ||
| // anchor its staleness check on the VersionedTransition (as ChasmTaskInfo does) rather than an | ||
| // event ID. | ||
| const chasmNoEventID int64 = -1 |
There was a problem hiding this comment.
this is just for the PoC to work, another PR is removing the dependence of eventID in time skipping
| return ms | ||
| } | ||
|
|
||
| // TestTimeSkipping_StartDelayAndRetryBackoff verifies that a standalone activity, which opts into |
There was a problem hiding this comment.
need to add more functional test cases in real code PR (like ff timer fired correctly
|
|
||
| for _, pureTask := range componentAttr.GetPureTasks() { | ||
| pureTask.PhysicalTaskStatus = physicalTaskStatusNone | ||
| if firstPureTask == nil || comparePureTasks(pureTask, firstPureTask) < 0 { |
There was a problem hiding this comment.
pure task is backed by one physical task, so here find the earliest one
|
|
||
| // TimeSkippingTransition is a time-skipping decision and is shared between the CHASM framework and | ||
| // the history substrate. | ||
| type TimeSkippingTransition struct { |
There was a problem hiding this comment.
temporary redundancy to avoid moving the same data structure from service/history to this folder
390149c to
9674980
Compare
| ctx context.Context, | ||
| transactionPolicy historyi.TransactionPolicy, | ||
| ) (needRegenTasks bool) { | ||
| // This is the workflow (history-event) time-skipping path. CHASM executions (e.g. standalone |
There was a problem hiding this comment.
this should be fixed in another PR that all workflow-specific paths should check this flag
a59298d to
6cf4bc3
Compare
6cf4bc3 to
6e5972a
Compare
| IsExecutionSkippable(ctx Context) bool | ||
| } | ||
|
|
||
| // TimeSkippingRuntimeTargetProvider is the optional, by default the framework scans the tree's |
There was a problem hiding this comment.
save this for later, just delete it
| // one (e.g. bare test mocks). | ||
| // | ||
| // TODO: Now() could be different for components after we support Pause for CHASM components. | ||
| if np, ok := n.backend.(nowProvider); ok { |
There was a problem hiding this comment.
always be backend
for discussion only
feature API branch: temporalio/api#802