Expand description
Shared managed-byte accounting. Reservations are ownership tokens, not allocations, an RSS limit, or a substitute for charging each consumer.
Structs§
- Budget
Snapshot - Point-in-time usage of one budget: configured limit, current and peak use.
- Byte
Budget - Child usage is included in every ancestor; creating children does not multiply the parent limit. Names are static component names, not tenant identifiers or unbounded metric labels. Dropping the last child handle and reservation releases its metadata without retaining a central registry.
- Byte
Reservation - Not Clone: exactly one owner releases each charge, including during unwind. Move this with the allocated buffer; do not drop it while retaining data.
- Fair
Admission - Bounded fair admission gate: serializes requests for bytes from a
budget and admits them in arrival order when capacity frees up, honoring a
caller deadline and an external cancellation flag.
try_reserveremains the non-blocking primitive; this adds bounded queueing, deadlines, and cancellation for work that must wait rather than fail immediately (e.g. group-commit staging, transaction buffers). - Storage
Resources - Initial embedded storage configuration, not a whole-process RSS promise.
Enums§
- Admission
Error - Admission error for a
FairAdmission::acquireattempt. A successful call returns the ownedByteReservation; failure returns one of these without charging bytes. - Durability
- Logical durability contract (research D10).
Localis the default and guarantees the commit is durable on this node before it is acknowledged.Asyncdoes not fsync: with redb 4.x the commit is not persisted until a laterLocalcommit or checkpoint, so an acknowledgedAsynccommit can be lost on a crash, power loss, or hard kill. It is intended only for re-importable bulk input, not as a weaker consistency mode.Memoryis only meaningful for in-memory stores. - Resource
Error - Errors from managed-byte accounting: invalid budgets, exhausted limits, and reservation ownership violations.
Functions§
- physical_
shard_ for - Deterministic tenant → physical shard mapping. Uses a fixed-width FNV-1a over the 32-byte tenant id so routing is restart-stable and independent of the in-memory admission-shard count. Commits without a tenant route to shard 0.