Expand description
2026-09-25: Paging core of the SSM snapshot tier: the peer’s TCP control protocol
and paging loops, the client side of that protocol (wire), and MmapSlotArena
(mmap_arena). Re-exports the generic tier types it builds on.
Owner: storage, SSM snapshot tier. Invariants: none beyond the types.
The peer runs a Residency over its RDMA-registered arena and an NVMe swap file,
and owns residency, so every client of one arena shares its cache. The paging
loops register no memory: blobs move between arena and swap under the rkeys each
connection registered in its handshake.
Re-exports§
pub use crate::tier::DirectSwapFile;pub use crate::tier::MemSwapStore;pub use crate::tier::Residency;pub use crate::tier::SlotArena;pub use crate::tier::SwapStats;pub use crate::tier::SwapStore;pub use crate::tier::VecSlotArena;
Structs§
- Mmap
Slot Arena - 2026-09-25:
SlotArenaover the peer’s mapped arena, from a raw base pointer. The peer copies between slots and its swap file; clients RDMA into and out of the same slots. The arena registers nothing; the peer registers the mapping per connection. - Paging
Kind - 2026-09-25: The tier a paging arena serves. Only
SSMandKVare accepted (parse_paging_header); the read-only expert and weight peers use their own handshake.
Enums§
- Paging
Reply - 2026-09-25: Result of one control request, ready to serialise.
Constants§
- OP_
ALLOC - OP_BYE
- OP_
COMMIT - OP_GET
- OP_
REMOVE - PAGING_
MAGIC_ V2 - 2026-09-25: The only accepted first u64 on the paging port, ASCII “PAGE” + 2. The
[u8 kind]that follows lets one peer keep an arena per(kind, blob_bytes). - ST_ERR
- ST_MISS
- ST_OK
Functions§
- client_
alloc - 2026-09-25: Reserve a slot for
keyand return its arena offset; a non-OK status is an error. - client_
bye - 2026-09-25: Tell the peer to end the paging loop; no reply is read.
- client_
commit - 2026-09-25: After the WRITE has completed, mark
keyresident. - client_
get - 2026-09-25:
Some(offset)to READ from, orNonewhen the peer has no such key. - client_
remove - 2026-09-25: Ask the peer to drop
key. - dispatch
- 2026-09-25: Execute one control op against
resand return the reply; no I/O, so the protocol is testable without a socket or RDMA. - encode_
paging_ v2_ header - 2026-09-25: The 25-byte header every client sends first, in paging and raw mode:
[u64 PAGING_MAGIC_V2 LE][u8 kind][u64 arena_bytes LE][u64 blob_bytes LE]. TheRailSetexchange follows it. - parse_
paging_ header - 2026-09-25: Parse the rest of the handshake header, given the first u64 the caller
has read:
[u8 kind][u64 arena_bytes][u64 blob_bytes]. A first u64 other thanPAGING_MAGIC_V2(with its own message for the “PAGE” + 1 value), or a kind other thanSSM/KV, is an error. - run_
paging_ loop - 2026-09-25: The peer’s control loop over one residency: read
[op][u64 key], dispatch, reply, until BYE or a failed read of the op byte. - run_
paging_ loop_ shared - 2026-09-25:
run_paging_loopover a residency shared by many connections, so a blob one client PUTs another can GET under the same key. The lock is held for each dispatch, which may move bytes to or from swap, and never across a TCP read or write. - staging_
chunk_ bytes - 2026-09-25: Chunk size of the striped snapshot transfer:
METRALE_SSM_CHUNK_BYTES, or 1 MiB when it is unset, unparsable or below 4096. - staging_
depth - 2026-09-25: Chunks in flight per rail:
METRALE_SSM_PIPELINE_DEPTH, or 16 when it is unset or unparsable, clamped to 1..=128. - stripe_
plan - 2026-09-25: Split a
blob_bytestransfer intochunk_byteschunks dealt round-robin ton_rails, as per-rail lists of(offset, len). The offset is the chunk’s position in both the staging buffer and the peer slot, so one copy assembles the blob whichever rail moved each chunk. Only the last chunk may be short. Zerochunk_bytesorn_railscounts as 1.