automatic time-skipping (don't merge, will split into smaller prs)#9617
automatic time-skipping (don't merge, will split into smaller prs)#9617feiyang3cat wants to merge 8 commits intotemporalio:mainfrom
Conversation
|
todo found: rebuild ms |
1e69592 to
8f8fae8
Compare
|
currently, ts transfer task is using timer-task (setting time = now), can migrate to immediate transfer task. |
8f8fae8 to
6eacb02
Compare
2463097 to
39ac713
Compare
| mutableState.approximateSize += dbRecord.ExecutionInfo.Size() - mutableState.executionInfo.Size() | ||
| mutableState.executionInfo = dbRecord.ExecutionInfo | ||
|
|
||
| if mutableState.executionInfo.GetTimeSkippingInfo().GetEnabled() { |
| } | ||
| for _, task := range ms.InsertTasks[tasks.CategoryTimer] { | ||
| if userTimerTask, ok := task.(*tasks.UserTimerTask); ok { | ||
| userTimerTask.VisibilityTimestamp = userTimerTask.VisibilityTimestamp.Add(-skippedDuration) |
39ac713 to
2e1df0a
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…art workflows data plane: rename persistencespb.TimeSkippedDetails
2e1df0a to
dd0297a
Compare
|
should merge API first and change api-go commitID |
| AddWorkflowExecutionTimeSkippedEvent(ctx context.Context, advanceToTimePoint time.Time) (*historypb.HistoryEvent, error) | ||
| ApplyWorkflowExecutionTimeSkippedEvent(ctx context.Context, event *historypb.HistoryEvent) error | ||
| IsAutoTimeSkippable() bool | ||
| VirtualTimeNow() time.Time |
There was a problem hiding this comment.
can consider just call it now, if there is no timeskipping ever happened, return shard.Now()
| "go.temporal.io/server/service/history/tasks" | ||
| ) | ||
|
|
||
| type ( |
There was a problem hiding this comment.
@yux0 this time-skipping feature is almost completed in this pr, and I think replication will naturally be covered by this change? (I haven't add feature testing for replication yet, will need to read a bit on how to do that
There was a problem hiding this comment.
should support both partialRefresh vs Refresh
|
need to add more in-repo feature testing (now the basic uses cases are contained, edgy cases are needed) |
add timeSkippingEvent to workflow rebuilder fix bugs of taskRefersher, and mutable virtual time The proto source had the api-linter suppression comment for to_time but the generated .pb.go was not updated to reflect it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dd0297a to
824d0c6
Compare
|
|
||
| // AfterFunc schedules f to run after duration d on the real wall clock. | ||
| // TODO(@feiyang): explore if this method needs to respect virtual time — currently it delegates | ||
| // to the base clock so f fires after d of wall time, not virtual time. |
| } | ||
|
|
||
| func (t *timerQueueActiveTaskExecutor) executeTimeSkippingTimerTask( | ||
| ctx context.Context, |
There was a problem hiding this comment.
todo, @feiyang3cat
if we still keep this in transferTask, need to check and test idempotency and granular error handling
14496ab to
4faf65c
Compare
4faf65c to
e6275d8
Compare
What changed?
add automatic time-skipping with fine-grained control, i.e. all features, unit-tests, feature tests are in this pr.
manual skipping, chasm related not yet included.
1. full control plane related:
- dc flag for the feature in a namespace
- opt-in to enable time-skipping when starting a workflow
- disable/enable time-skipping with workflowUpdateOptions
- API related:
2. data plane:
- on mutation/snapshot a timeskipping transfer task is created with the transaction
- handling of time-skipping transfer-task: transaction (calculate time to be skipped, update virtual time of the ms, generate new timertasks with new virtual time)
- timeSkippingTimeSourceImpl and mutableState vitualTime
- mutableState rebuild
How did you test it?