temporalio / temporalio/temporal

Missing shard ownership check in speculative workflow task processing may cause incorrect update rejections

Open
#10,478 2 comments 0 reactions 1 assignee View on GitHub

@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

  1. Set up a Temporal cluster with multiple history service
    instances sharing shard ownership
  2. Submit a workflow with pending update requests
  3. Trigger a shard ownership transfer mid-speculative-WFT
    (e.g., restart a history pod)
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.