Skip to content

[Brook] Let service creates and appends name the owner run and withdraw_run. - #35

Closed
moetemp wants to merge 2 commits into
moe/brook/v4/s17-writer-witfrom
moe/brook/v4/s18-service-run-withdrawal
Closed

moetemp wants to merge 2 commits into
moe/brook/v4/s17-writer-witfrom
moe/brook/v4/s18-service-run-withdrawal

Conversation

@moetemp

@moetemp moetemp commented Oct 22, 2026

Copy link
Copy Markdown
Owner

What changed?

This PR lets the service CreateStream and AppendRecords take a Workflow's calls from outside Workflow code, as S108's Local Activities make them.
CreateStreamRequest.owner (6) names the owning run. With it, the Stream is created Workflow-owned and keeps the safety TTL, which needs the safety_ttl capability. withdraw_run on CreateStream and AppendRecords now reaches the Store, so a retry run's first call to a Stream withdraws the previous run, which needs the run_fence capability. The create's Superseded facts have no epoch, so a Reader withdraws only that run. The proto gets close_with_run (7) and ref (8) too, the server's text, which only the native Store reads. A deduplicated append still answers the stored batch's offsets.

Why?

Decision S108. Workflow publish, create and close become one Local Activity each, on the Activity writer path. The run buffer used to send withdraw_run, and that path dropped it.

How did you test it?

cargo fmt --all -- --check, cargo clippy --workspace --tests -- -D warnings (also with --no-default-features --features tls-aws-lc), and STREAMS_REQUIRE=redis cargo test --workspace on standalone Redis, cluster Redis and memory. A new service test runs a previous run's Local Activity append, then a retry run's create and append with withdraw_run, and a resend of that append. It checks the Superseded item withdraws only the previous run, and that the resend keeps its offsets.

@moetemp

moetemp commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Closing as stale. This layer is folded into the v5 tip, #41, and the upstream review uses a fresh series instead. Plan: https://www.notion.so/4048fc567738814990b7c796ac28fe3f

@moetemp moetemp closed this Oct 25, 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