Expand description
High-level tenancy layer.
Translates declarative tenancy rules (partition key, doc-id construction,
injected/sensitive fields, placement lookup) into low-level routing
decisions, so most implementers never touch RouteDecision plumbing
(docs/02, docs/03).
Two pieces:
PlacementTable, the in-memory, epoch-versioned partition→placement map that backs an implementer’splacement_forlookup (M1; fleet store in M7).TenancyRouter, adapts aTenancySpiinto aRoutingSpi, resolving the partition, looking up placement, and assembling the body transform.
Structs§
- Placement
Table - A concurrent, epoch-versioned map from partition to placement, carrying each
partition’s migration state machine (
docs/06). - Resolved
- A fully resolved routing decision plus the partition it was resolved for.
- Tenancy
Router - Turns a
TenancySpiimplementation into aRoutingSpi.
Enums§
- Migration
Error - Why a migration state transition was refused: the transition does not apply to the partition’s current state. Transitions are total and side-effect-free on failure, so a refused transition leaves the table unchanged.
- Partition
State - A partition’s placement state: settled, or migrating between two placements.
- Phase
- The phase of an in-flight migration (
docs/06§3). - Write
Admission - Whether a write resolved at a past epoch may still commit (the migration
write gate,
docs/06§2).
Traits§
- Router
- The partition-aware routing seam the engine pipeline drives.
Functions§
- resolve_
partition_ spec - Resolves the partition id by trying
spec’s sources in order, the declarative resolver mostosproxy_spi::TenancySpi::resolve_partitionimplementations defer to.