Skip to content

Skip replication updates for deleted-workflow orphan runs#10673

Draft
jiechenz wants to merge 1 commit into
mainfrom
jiechenz/skip-deleted-wf-apply
Draft

Skip replication updates for deleted-workflow orphan runs#10673
jiechenz wants to merge 1 commit into
mainfrom
jiechenz/skip-deleted-wf-apply

Conversation

@jiechenz

@jiechenz jiechenz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

What changed?

On the passive replication-apply path, dispatchForExistingWorkflow now treats a closed target run with no current execution record (currentRunID == "") as a deleted-workflow no-op.

Why?

A reset/continue-as-new + delete the current run can leave the old closed run as orphan, this is true on passive side as workflow deletion will replicate to passive as well.

Then a force-replication SyncWorkflowState task on that orphan will hit currentRunId == "" and results in "unable to locate current workflow during update" error.

This fix skip the SyncWorkflowState when orphan is in post-deletion state.

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

  • If a closed run legitimately should have a current record but it's missing due to a different bug, this now silently skips (logged) rather than surfacing — masking that class of inconsistency for closed runs

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.

1 participant