temporalio / temporalio/temporal
Missing shard ownership check in speculative workflow task processing may cause incorrect update rejections
Open
@yux0 is already working on this.
Since Jun 11, 2026.
potential-bug
- Dominant language
- Go
- Stars
- 23.2k
- Forks
- 1.9k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 228
Description
Expected Behavior
Speculative workflow task processing should verify shard
ownership before completing, ensuring that workflow update
requests are not rejected due to stale mutable state caused
by a shard ownership change mid-execution.
Actual Behavior
No shard ownership check is performed during speculative
workflow task processing. If shard ownership changes
mid-execution, the task completes on stale mutable state,
causing valid workflow update requests to be incorrectly
rejected with no error logged.
Steps to Reproduce the Problem
- Set up a Temporal cluster with multiple history service
instances sharing shard ownership - Submit a workflow with pending update requests
- Trigger a shard ownership transfer mid-speculative-WFT
(e.g., restart a history pod) - Observe workflow updates incorrectly rejected despite
being valid
Specifications
- Version: latest main
- Platform: any
- Affected file: service/history/workflow/workflow_task_state_machine.go:759
- Related API: AssertShardOwnership (fully implemented in persistence layer)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.