Skip to content

WIP: time skipping turns to versioned transition for task validation#10894

Open
feiyang3cat wants to merge 9 commits into
temporalio:mainfrom
feiyang3cat:ts-rf-tstimertask
Open

WIP: time skipping turns to versioned transition for task validation#10894
feiyang3cat wants to merge 9 commits into
temporalio:mainfrom
feiyang3cat:ts-rf-tstimertask

Conversation

@feiyang3cat

@feiyang3cat feiyang3cat commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

What changed?

  1. remove event ID from and add archetypeID to the time skipping timer task
  2. add VersionedTransition in time skipping timer task/time skipping info for cross/intra cell task validation

Why?

  1. chasm executions don't have event ID and need archetypeID for loading ctx
  2. VersionedTransition.FailOver can help find out stale tasks during failover and failback
  3. VersionedTransition.TransitionCount can help find out stale tasks when fast-forward is overwritten

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

@feiyang3cat feiyang3cat requested review from a team as code owners June 30, 2026 23:11
@feiyang3cat feiyang3cat force-pushed the ts-rf-tstimertask branch 4 times, most recently from 3a69d46 to 3e6e359 Compare July 1, 2026 00:18
@feiyang3cat feiyang3cat changed the title time skipping timer task use stamp and version than event id for validation WIP: time skipping timer task use stamp and version than event id for validation Jul 1, 2026

// This is the NamespaceFailoverVersion at which this fast-forward was configured.
// It is used to validate the time skipping fast-forward timer task.
int64 version = 5;

@yycptt yycptt Jul 1, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have super strong opinion but ideally I think we should use the (LastUpdate)VersionedTransition concept/primitive here (which is invented for this validation purpose) and be consistent with how we are tracking "component" updates and validating component tasks in the state-based replication & CHASM world.

I understand all existing workflow transfer/timer tasks are using their own version field, but that's something we are gradually moving away from as we migrate more and more components onto CHASM. and hopefully one day we can have only one approach for tracking and invalidating tasks.

cc @xwduan

@feiyang3cat feiyang3cat changed the title WIP: time skipping timer task use stamp and version than event id for validation WIP: time skipping turns to versioned transition for task validation Jul 1, 2026
@feiyang3cat feiyang3cat requested a review from a team as a code owner July 1, 2026 23:02
@feiyang3cat feiyang3cat force-pushed the ts-rf-tstimertask branch 8 times, most recently from b6dd7fa to 54ac021 Compare July 2, 2026 20:42
}

// always install a fresh fast-forward bound
currentVersionedTransition := ms.CurrentVersionedTransition()

@feiyang3cat feiyang3cat Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to confirm my understanding :

there won't be a case where there is time skipping feature in the system while versioned transitioned returned nil (= transition history is not enabled

@feiyang3cat feiyang3cat force-pushed the ts-rf-tstimertask branch 2 times, most recently from 466df66 to 49282c0 Compare July 2, 2026 23:46
TaskTypeTagProvider func(t tasks.Task, isActive bool, chasmRegistry *chasm.Registry) string
)

// terminalTaskError indicates a task hit an unexpected, unrecoverable invariant violation in its

@feiyang3cat feiyang3cat Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better we have a unified way/generic way to check unexpected invariants failures in tasks, they shouldn't be retried, but need logs/metrics and optionally need dlq (and I didn't add dlq needed flag as right now dlq is treated not as a per-task choice by design and I don't want to couple this pr with this change).

adding a generic implementation of this MaybeTerminalTaskError maybe a choice, but
need a closer look at this design if this is the best one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants