Repository navigation
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
This PR serves direct Workflow reads with no Records in History (S105).
ReadRecordsRequest.to_offsetbounds a read, so a replay reads the same range.wake_onlyparks as a read and answers with no Records andnext_offset = from_offset.WorkflowService.StartNexusOperation(temporalio/api#720 shape) runs a__temporal_systemoperation for the caller's namespace with no caller-side state and no History event. It is behindfrontend.enableDirectNexusCalls. A directReadRecordslong-polls up towaitas 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_expiredhas the NotFound code.Why?
A Workflow wakes on a
wake_onlyNexus 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 withstream_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_offsetanswers 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 withstream_not_found, and a read of a range that the size cap dropped fails withstream_expired.