Skip to content

Commit acaae62

Browse files
antiguruclaude
andauthored
compute: a per-process registry of published index arrangements
Publishing an arrangement produces handles, but a reader on another thread needs a way to find them. This adds a registry keyed by `GlobalId` and worker ordinal, shared across all timely workers of a process the way the persist client cache is, so worker `i` publishes into slot `i` and a reader on worker `i` of another runtime looks up the same slot. That is sound only because both sides shard keys by `key.hashed() % peers`, which the equal-peer requirement guarantees. A slot can be created before it is filled. `get_or_create_placeholder` lets whichever side touches an id first create the slot and the other adopt it in place, so a reader never overwrites a publisher's arrangement or imports over a slot that a later publish replaces. Readers learn about publication and seal through a dirty-id inbox with a coalescing `SyncActivator` rather than by polling. Nothing in the crate calls the registry yet, so it is inert in the same sense as the shared-trace primitive it builds on. `published_logical_holds` is `pub` because its callers arrive later and crate scoping would make it unreachable for dead-code analysis. Tests are out of line in `sharing/tests.rs`, per the convention in `src/compute/AGENTS.md`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 870f336 commit acaae62

3 files changed

Lines changed: 1516 additions & 0 deletions

File tree

src/compute/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ mod logging;
2222
mod metrics;
2323
mod render;
2424
pub mod shared_trace;
25+
pub mod sharing;
2526
/// MV sink machinery, exposed for benchmarks.
2627
#[cfg(feature = "bench")]
2728
pub mod sink;

0 commit comments

Comments
 (0)