Skip to content

Detect coalesced update ordering in Schedule V2 replay - #2

Closed
davidporter-id-au wants to merge 0 commit into
schedule-v2-replay-fidelityfrom
fix/schedule-v2-replay-update-ordering
Closed

davidporter-id-au wants to merge 0 commit into
schedule-v2-replay-fidelityfrom
fix/schedule-v2-replay-update-ordering

Conversation

@davidporter-id-au

Copy link
Copy Markdown
Owner

Summary

  • associate captured V1 starts with their workflow-task completion
  • detect an update signal delivered after workflow-task scheduling but before workflow-task start
  • classify input differences at this boundary as inconclusive instead of a significant V2 divergence
  • add a sanitized workflow-history regression test

Why

V1 can consume a timer and update in one workflow task. The event-by-event harness may fire the nominal CHASM deadline before it encounters the update event, producing an old-input versus new-input false positive.

Production replay evidence

The representative request-input case moves from significant to inconclusive with the causal name v1_workflow_task_input_ordering.

Test plan

  • go test -tags test_dep ./chasm/lib/scheduler -run ^TestWorkflowTaskContainsUpdateBeforeStart$ -count=1
  • representative three-history production replay

@davidporter-id-au
davidporter-id-au force-pushed the fix/schedule-v2-replay-update-ordering branch from 7659e3f to 1fb7419 Compare August 13, 2026 06:14
@davidporter-id-au

Copy link
Copy Markdown
Owner Author

Superseded by a draft PR against temporalio/temporal:main.

davidporter-id-au added a commit that referenced this pull request Aug 20, 2026
#1: HandleNexusCompletion now resolves BufferedStarts via
getBufferedStart, not invoker.runningWorkflowID (which has zero
production callers left, confirmed by repo-wide grep). But
executeNexusCompletion's shared driver was still asserting through
that orphaned helper for six tests (Success, Failure, Canceled,
PauseOnFailure, ReenablesDeferredStarts, CompletionBeforeStart) --
they happened to still pass since both functions filter on
Completed==nil, but a future divergence between them would go
unnoticed. Replaced with a direct check against invoker.BufferedStarts
by RequestId, which is what the real completion path actually touches.

#2: TestHandleNexusCompletion_AllowAllDoesNotUpdateCompletionState only
ever exercised resolveOverlapPolicy's UNSPECIFIED-falls-back-to-the-
schedule's-live-policy branch (it sets the schedule's OverlapPolicy to
ALLOW_ALL but never stamps the BufferedStart's own OverlapPolicy
field). Production always stamps a concrete policy onto BufferedStart
at buffer time (spec_processor.go, backfiller_tasks.go), so completion
should be reading that stamped value, not falling back to the
schedule's current policy. Added
TestHandleNexusCompletion_AllowAllReadsStartsOwnPolicy, which stamps
ALLOW_ALL on the start while leaving the schedule's own policy at its
Skip default -- verified by temporarily reverting
HandleNexusCompletion to read the schedule's live policy instead and
confirming this new test fails, then restoring the fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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