Module table
Expand description
The run table: one 32-byte entry for every run a shard knows, loaded or parked, found by run ID or by workflow ID hash.
A parked run lives only here: where its journal is in the run store, its earliest timer (or, once finished, when it finished) and its status. Entries sit in fixed chunks, so growing never copies them and never leaves more than one chunk unused. Two open-addressing indexes of 4-byte buckets find an entry by run and by ID hash; each is rebuilt to about 65% full when it reaches 85%, so a parked run costs 32 + 2 × 4 / load bytes: 41.4 to 44.3.
The same 32 bytes (without the in-memory flags) are the record format of
the persisted index (see crate::store::StoreEntry::Index).
Modules§
- flag
- In-memory flags.
Structs§
- Entry
- One run. Four words: the ID hash; the run ID (48 bits), state and flags; the store offset (48 bits) and the low half of the frame length; the time (48 bits) and the high half of the length.
- RunTable
- See the module documentation.
Constants§
- CHUNK
- CHUNK_
BITS - Entries per chunk of the table, as a power of two. A chunk is 512 KiB: above glibc’s mmap threshold (which the engine fixes at 256 KiB), so each chunk is mapped on its own instead of sitting in a thread’s heap among loaded runs’ short-lived blocks, where it would keep the pages around it resident after those are freed.
- DELETED
- Only in persisted index deltas: the run is gone.
- DONE
DONE + status: parked, finished with that status.- LOADED
- Entry states.
- PARKED
- RECORD
- Size of one entry and of one persisted index record.
Type Aliases§
- Slot
- Position of an entry. Stable while the entry exists, until
RunTable::compact.