Expand description
luci-storage — block-based storage engine for Luci.
This crate implements the [[single-file-format]] that backs every Luci index. It manages disk space as fixed-size blocks, tracks free space with extent-based free lists, and provides atomic commit via a two-root-pointer technique.
See [[architecture-storage-format]] for the full design.
Modules§
- lock
- Five-state file locking protocol for cross-process coordination.
Structs§
- Block
Allocator - Block allocator with extent-based free-list tracking.
- BlockId
- Identifies a block by its zero-based index within the data region.
- Extent
- A contiguous range of blocks:
[start, start + count). - File
Header - The 4 KB file header for a
.luciindex file. - Metadata
Snapshot - Point-in-time snapshot of all index metadata, stored in the metadata root block referenced by a root pointer.
- Root
Pointer - A root pointer in the file header.
- Segment
Entry - An entry in the segment directory mapping a segment to its block location.
- Single
File Directory - Production storage backend: all data in a single
.lucifile using the block allocator and two-root-pointer atomic commit. - Vector
Index Entry - An entry in the vector-index directory mapping a
dense_vectorfield to the file extent holding its serialized search index (HNSW graph today; other algorithms in the future). - Wal
- Write-ahead log for buffering document operations between commits.
Enums§
- Active
Root - Identifies which root pointer is active.
- Durability
Mode - Durability mode controlling when WAL writes are fsynced to disk.
- WalRecord
- A single WAL record: either a document put or delete.
Constants§
- BLOCK_
SIZE - Block size in bytes: 256 KB.
- FORMAT_
VERSION - Current format version. Incremented on breaking format changes.
- HEADER_
SIZE - Size of the file header in bytes: 4 KB.
- MAGIC
- Magic bytes identifying a Luci index file.
Traits§
- Storage
- Trait abstracting over storage backends.
Functions§
- replay_
wal - Replay a WAL file, returning all valid records.
- xxh3_
checksum - Compute the xxHash (XXH3-64) checksum of a metadata root block.