Repository navigation
Conversation
This was referenced Oct 27, 2026
moetemp
force-pushed
the
moe/brook/review/streams-k8-reads
branch
from
October 27, 2026 07:35
bbe1e40 to
bd7cdf3
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k7-withdrawals
branch
from
October 27, 2026 07:35
d21bc6e to
e12bbce
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k8-reads
branch
from
October 27, 2026 08:17
bd7cdf3 to
a428ee2
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k7-withdrawals
branch
from
October 27, 2026 08:17
e12bbce to
855fbbc
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k8-reads
branch
from
October 27, 2026 16:55
a428ee2 to
08eb55b
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k7-withdrawals
branch
from
October 27, 2026 16:55
855fbbc to
1228850
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k8-reads
branch
from
October 27, 2026 23:46
08eb55b to
913292f
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k7-withdrawals
branch
2 times, most recently
from
October 28, 2026 08:55
8601859 to
70da9b2
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k8-reads
branch
from
October 28, 2026 08:55
913292f to
04b1a06
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k7-withdrawals
branch
from
October 29, 2026 04:06
70da9b2 to
7363e49
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k8-reads
branch
from
October 29, 2026 04:06
04b1a06 to
1970b1f
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k7-withdrawals
branch
from
October 29, 2026 08:37
7363e49 to
eb4a41f
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k8-reads
branch
2 times, most recently
from
October 29, 2026 09:17
c454268 to
a42f66d
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k7-withdrawals
branch
from
October 29, 2026 09:17
eb4a41f to
9416b54
Compare
A Local Activity write with its run's task facts withdraws the Records of the run's tasks that never completed, and a retry run's first write withdraws and fences the previous run. The task facts come from Core field 20. The memory Store declares `RUN_FENCE`, and the suites check the rules on every Store.
moetemp
force-pushed
the
moe/brook/review/streams-k8-reads
branch
from
October 29, 2026 10:03
a42f66d to
84fb6ca
Compare
moetemp
force-pushed
the
moe/brook/review/streams-k7-withdrawals
branch
from
October 29, 2026 10:03
9416b54 to
64c31e5
Compare
The service suite keeps K8's close status case after K7's withdrawal cases.
# Conflicts: # crates/streams/src/service.rs # crates/streams/src/testing/service.rs
# Conflicts: # crates/streams/src/service.rs
A task can fail before its call writes, so no orphan item withdraws that call's later Records. The Store keeps the task facts of the run's highest task in `tf|<run>` and fences a write whose task they show never completed.
A write with no task facts, as from an older Core, stayed out of `oa`, so no later orphan item withdrew its Records. Every Local Activity write with Records adds its task to `oa`, and only a write with facts applies the orphan rule.
Such a batch dropped `h|`, though its run item doesn't withdraw the held epoch's Records. Then the Producer's next epoch didn't flag, and those Records stayed. Only a newer epoch drops `h|`.
`ow|<run>|<task key>` matches the Redis layout, so the fence reads one field. The shared vectors name the `oa|`, `ow|` and `tf|` fields, and two shared cases cover a batch with two items and a resend of an orphan batch.
The `tf|<run>` value is the task keys back to back, all made by `task_key`. So a change of the key's format reaches the field with no other change.
`oa|<run>` holds task keys of one width with no separator, as `tf|<run>` does. So binary task keys fit it with no other change.
Only a Local Activity sends its run's task facts, and a started event id is positive. Both Stores dropped the facts of other Producers, and the run facts turned a zero or negative id into the zero key.
The task facts check reads the kind of the Producer's case. In the suite, a retry run's create uses the Stream that its previous run made.
A retry reads the same oa or tf field, so the error isn't retryable.
The withdrawal cases carry their StreamRef in ref and in stream_ref, as the other suites do.
The orphan item's writer is the run's Workflow Producer with the batch's task facts. The withdrawal suite changes the facts through the request's writer.
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 retry run rule and the orphaned Local Activity rule to the service and the memory Store.
RUN_FENCE.temporal-community/sdk-streams#2.Depends on #217 (K8), for
ReadRecordsin the tests. Review lane is the Rust reviewers, and the Redis and Lua reviewers with R2.Part of the Brook review series.
Why?
The orphan rule is the hardest part to review, and it uses Core field 21 (C1,
temporalio/sdk-rust#1703).Known limits, open for review.
owkeeps every withdrawn task of a run, so it grows with the run.docs/redis.mdlists the others. They are a Local Activity that outlives its task, a retry run after a run that never wrote, a close before a retried failure, and a reset.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.