Skip to content

[Brook] Split the Store into log calls and declared capabilities. - #25

Closed
moetemp wants to merge 1 commit into
moe/brook/v3/s8-stream-ref-ownerfrom
moe/brook/v3/s9-store-capabilities
Closed

moetemp wants to merge 1 commit into
moe/brook/v3/s8-stream-ref-ownerfrom
moe/brook/v3/s9-store-capabilities

Conversation

@moetemp

@moetemp moetemp commented Oct 21, 2026

Copy link
Copy Markdown
Owner

What changed?

This PR splits the Store trait into the required log calls and capability calls. The log calls are create, the atomic batch append, read with the Stream's state, and wait_after. close and wait_replicas become optional calls that refuse by default. capabilities() has no default, so a wrapper Store must say what it forwards. The capabilities are producer_fence, withdrawal, run_fence, close, replica_wait and safety_ttl, one per rule that the Lua scripts keep atomically. The service and the Workflow path check them before any write. A missing one fails with UNIMPLEMENTED and the reason stream_unsupported, and the message names the capability. RedisStore declares all of them. MemoryStore declares all but replica_wait, so durable_writes on memory now fails by name. MemoryStreamExtension::from_config_bytes now reads durable_writes.

Why?

A Store with fewer guarantees must refuse a call it can't keep. It must not give a weaker answer in silence. This is the split of the 2026-10-16 capability design fitted to v3, with no reader-side fallbacks yet.

How did you test it?

STREAMS_REQUIRE=redis cargo test -p temporalio-streams, on standalone Redis, cluster Redis and the memory Store. New tests mask one capability at a time on a memory Store wrapper. Each needed call is refused by name with nothing written, and the Stream stays as it was. A test also checks that every Store and wrapper reports its capabilities, the Redis durable view included.

  • Unit Tests
  • Staging
  • End to End Tests

A Store that can't fence, flag, close or wait for replicas must refuse the calls that need them by name, not give weaker guarantees in silence. The memory Store now refuses durable_writes for that reason.
@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