Skip to content

feat: remove the owner and the withdrawal machinery - #6

Closed
moetemp wants to merge 68 commits into
moe/brook/review/r3-writer-suitefrom
moe/brook/review/r3-close-item
Closed

moetemp wants to merge 68 commits into
moe/brook/review/r3-writer-suitefrom
moe/brook/review/r3-close-item

Conversation

@moetemp

@moetemp moetemp commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

This PR removes the owner and the withdrawal machinery from the Redis Store, to match the Stream crate.

The close is a read item with a Producer and a status, and the Store keeps no withdrawal facts. Supersession moves to an opt-in client helper.

The Lua scripts apply the withdrawal rules of `temporalio-streams`. A Local
Activity write with its run's task facts withdraws the Records of the run's
failed tasks, and a retry run's first write withdraws and fences the previous
run. The Redis Store declares `RUN_FENCE`.
The writers of `temporalio-streams` keep their epoch and `sequence` order on the
Redis Store too, standalone and on a cluster.
R2's withdrawal code now returns R1's Redis error type, in the moved store.rs.
# Conflicts:
#	crates/streams-redis/lua/append.lua
# Conflicts:
#	crates/streams-redis/src/store.rs
A create took any flag but 1 as unflagged, as the append did.
# Conflicts:
#	crates/streams-redis/src/store.rs
# Conflicts:
#	crates/streams-redis/docs/redis.md
#	crates/streams-redis/lua/append.lua
#	crates/streams-redis/lua/close.lua
#	crates/streams-redis/lua/create.lua
#	crates/streams-redis/src/store.rs
#	crates/streams-redis/tests/capabilities.rs
One string of all withdrawn tasks grew with each failed attempt, and every Local Activity append of the run parsed it. Behavior doesn't change.
Task keys compare as bytes, and temporalio-streams writes them in lowercase.
A batch can have two entries with s, a fenced run's resend and close keep their answers, and two kinds of late write stay visible in both Stores.
Both run commands that a plain create, append and close don't.
# Conflicts:
#	crates/streams-redis/docs/redis.md
#	crates/streams-redis/lua/append.lua
#	crates/streams-redis/src/store.rs
Only a newer epoch's item withdraws the held epoch's Records. So the Producer's next epoch still withdraws them, as in the memory Store.
A write from an older Core gives no task facts. Its task now goes in `oa` too, so that a later write's facts can withdraw its Records.
A task can fail before its call writes, so no orphan item withdrew it. `tf|<run>` keeps the facts of the run's highest task, and an append checks its task against them.
moetemp and others added 27 commits November 4, 2026 16:47
Maple's review shaped the types, the argument encoding and the tests of this PR.

Co-authored-by: Maple Xu <45406854+xumaple@users.noreply.github.com>
Maple's review shaped the Store and the tests that this PR runs the writer suite on.

Co-authored-by: Maple Xu <45406854+xumaple@users.noreply.github.com>
R1 follows the crate's new wire. R2's create keeps its withdrawal on the path that uses an existing Stream, after the conflict check, and its Local Activity task comes from the epoch's case.
R1 splits the storage reasons and closes with no Record. R2's close keeps its retry run fence, and a partial task key or short task facts are storage corrupt.
# Conflicts:
#	crates/streams-redis/lua/append.lua
#	crates/streams-redis/src/store.rs
A retry run's creates and appends withdraw the previous run, and Local Activities of three Workflow Tasks give random task facts. These rules are the longest part of the append script.
# Conflicts:
#	crates/streams-redis/tests/parity.rs
A batch gives its task facts and its run to withdraw in StreamWriter, and the orphan facts' StreamSuperseded has a writer. The create keeps its own withdraw_run.
The close keeps the closer and the status in the meta hash, and the read returns
them, so the shared service builds the final item at the offset after the newest
Record.
The Redis Store drops the owner check and the withdrawal and task-fact machinery, matching the sdk-core crate. The Producer field is 88 bytes, a read gives only Records and the final close item, and every open Stream keeps the safety_ttl after its last write.
@moetemp
moetemp force-pushed the moe/brook/review/r3-writer-suite branch from 42585c3 to 0620162 Compare November 9, 2026 08:14
@moetemp

moetemp commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this. Its changes are folded into the stack. #1 now drops the owner check and the withdrawal machinery and ends a closed read with a StreamClose item, and #3 (the writer suite) rebases onto #1. Nothing here is lost.

@moetemp moetemp closed this Nov 9, 2026
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