Skip to content

Preserve the original workflow start time on RebuildMutableState - #11668

Open
simvlad wants to merge 1 commit into
temporalio:mainfrom
simvlad:fix-rebuild-preserve-start-time
Open

Preserve the original workflow start time on RebuildMutableState#11668
simvlad wants to merge 1 commit into
temporalio:mainfrom
simvlad:fix-rebuild-preserve-start-time

Conversation

@simvlad

@simvlad simvlad commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

What changed?

AdminRebuildMutableState, invoked by tdbg workflow rebuild, no longer replace the mutable state start time with the current time. It reuses the run's recorded start time, falling back to ExecutionInfo.StartTime. Only in case if both ExecutionState.StartTime and ExecutionInfo.StartTime are empty, the current time will be used.

Note one behavior change - a workflow rebuilt after its original run timeout would have expired now times out promptly instead of getting a fresh timeout window.

Why?

Moving the start time to now, often results in workflow with the negative duration, since the end time is kept as is. This could be not handled way by downstream systems.

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)

Potential risks

  1. Some downstream systems may prefer the workflow start time to move.
  2. Admin may intent for the workflow to have a new timeout instead of getting a timeout

@simvlad
simvlad requested a review from a team August 19, 2026 23:08
@simvlad
simvlad requested review from a team as code owners August 19, 2026 23:08
Comment thread service/history/workflow_rebuilder.go Outdated
@simvlad
simvlad force-pushed the fix-rebuild-preserve-start-time branch from 9d61c21 to f0c02b6 Compare August 20, 2026 19:59
@simvlad
simvlad force-pushed the fix-rebuild-preserve-start-time branch from f0c02b6 to f124cd2 Compare August 20, 2026 20:09
@yycptt yycptt added the reliability-2026 Reliability related changes label Aug 21, 2026
@yycptt

yycptt commented Aug 21, 2026

Copy link
Copy Markdown
Member

a workflow rebuilt after its original run timeout would have expired now times out promptly instead of getting a fresh timeout window.

I think we need to discuss this. The command is not that useful if stuck execution will be immediately timedout after rebuild. And I think we observed case where after rebuild an execution timedout immediately even with current implementation.

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

Labels

oss-foundations reliability-2026 Reliability related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants