Commit acaae62
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
0 commit comments