Skip to content

[Jetty] Served direct Workflow reads with no Records in History. - #95

Draft
moetemp wants to merge 5 commits into
moe/jetty/v2/t6-nested-streamfrom
moe/jetty/v2/t7-direct-reads
Draft

moetemp wants to merge 5 commits into
moe/jetty/v2/t6-nested-streamfrom
moe/jetty/v2/t7-direct-reads

Conversation

@moetemp

@moetemp moetemp commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

What changed?

This PR serves direct Workflow reads with no Records in History (S105).
ReadRecordsRequest.to_offset bounds a read, so a replay reads the same range. wake_only parks as a read and answers with no Records and next_offset = from_offset.
WorkflowService.StartNexusOperation (temporalio/api#720 shape) runs a __temporal_system operation for the caller's namespace with no caller-side state and no History event. It is behind frontend.enableDirectNexusCalls. A direct ReadRecords long-polls up to wait as the frontend read does, so native reads use this one transport.
A Stream error keeps its reason through the framework. The framework rewrites a component's NotFound error into a missing execution, and stream_expired has the NotFound code.

Why?

A Workflow wakes on a wake_only Nexus read whose result is offsets only, then reads its pages directly. The SDK records offsets, and replay reads [from, to_offset) again. A range that Retention trimmed fails with stream_expired.

How did you test it?

A functional test: a Workflow wakes with offsets only, a direct page adds no History event, a page bounded by to_offset answers the same after more appends, and a direct read of a missing Stream fails with the reason in its details. Other functional tests: an append to a Stream that is not there fails with stream_not_found, and a read of a range that the size cap dropped fails with stream_expired.

  • Unit Tests
  • Staging
  • End to End Tests

A wake_only read in History gives the Workflow offsets only, and its pages come through the direct System Nexus call (api#720 shape) or the frontend, bounded by to_offset so replay reads the same range (S105).
…ect-reads

# Conflicts:
#	tests/stream_test.go
With one transport for native reads, a direct call reads as the frontend ReadRecords does.
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