Repository navigation
Conversation
moetemp
force-pushed
the
moe/brook/review/streams-k3-store-trait
branch
from
October 27, 2026 07:35
4a9d1b5 to
5e50e8d
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k2-ids-vectors
branch
from
October 27, 2026 08:17
3c800ad to
f5d807e
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k3-store-trait
branch
from
October 27, 2026 08:17
5e50e8d to
92528cb
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k3-store-trait
branch
from
October 27, 2026 16:55
92528cb to
a6020ca
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k2-ids-vectors
branch
2 times, most recently
from
October 27, 2026 23:46
16de1da to
bd35e0c
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k3-store-trait
branch
from
October 27, 2026 23:46
a6020ca to
614cf9c
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k2-ids-vectors
branch
from
October 28, 2026 08:55
bd35e0c to
fe3f05a
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k3-store-trait
branch
from
October 28, 2026 08:55
614cf9c to
3fcf1b2
Compare
A Store declares the rules it applies atomically beyond the log, and the service refuses a call that needs a capability the Store lacks. The trait is small so that the Redis Store and a native Store can implement it too.
moetemp
force-pushed
the
moe/brook/review/streams-k2-ids-vectors
branch
from
October 29, 2026 04:06
fe3f05a to
98ba416
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k3-store-trait
branch
from
October 29, 2026 04:06
3fcf1b2 to
a759d72
Compare
# Conflicts: # crates/streams/src/lib.rs
Each Store applies its own default Retention when a create sets none.
A call with no writer state sends no sequence. Only the Store can number such a batch in the same step as its dedupe check, so a Store declares that it does.
The batch digest is binary, so a Store gets the bytes that it keeps in the dedupe entry.
A create of an existing Stream fails unless it uses that Stream or retries the create that made it. The create's inputs are one struct, so the call stays short.
A close writes no log entry, so the state says the Stream is closed and its newest offset is final. A wait for the next entry also ends at a close.
The proto type is now StreamRef. A bare ref is a Rust keyword, so the parameter is stream_ref.
The review asked to stop representing invalid states. The Producer kind is now a oneof with run_id only in the run-based variants, so a client can't carry a run. A write's task facts and withdraw_run move into RunWithdrawal, which only a run writer sets.
Owner
Author
|
Closed in favor of #228, the combined branch, which has this change. |
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 adds the
Storetrait, the stored Record and batch limits, and the Store capabilities.owner_chaingives a Workflow owner's run chain as<workflow id>:<first run id>. A Store keeps it and checks it on a create and a close.Store::createtakes oneCreate, with aConflictPolicyand a request id.CreateOutcomehas onlyCreatedandExists. A Store refuses a create of a Stream that is expired, has another owner or is closed, in this order. Then a retry with the request id of the create that made the Stream getsCreated, and any other create of an open Stream fails withalready_existsunless its policy isUseExisting.Closedsays only whether the Stream was closed already.MAX_TTL, the largest proto Duration, bounds a Retention and a safety TTL.Depends on #213 (K2). Review lane is the Rust reviewers.
Part of the Brook review series.
Why?
The memory Store, the Redis Store and later a native Store implement this trait. A small PR keeps the contract apart from any one Store.
How did you test it?
cargo fmt,cargo clippy -- -D warnings(with and without features),cargo test -p temporalio-streams --all-featuresandcargo docpass at this commit.