pub struct StorageResources {Show 21 fields
pub managed_limit_bytes: usize,
pub page_cache_bytes: usize,
pub transaction_pool_bytes: usize,
pub durability: Durability,
pub shard_count: usize,
pub experimental_multi_shard: bool,
pub max_group_count: usize,
pub max_group_bytes: usize,
pub max_group_delay_ms: u64,
pub log_segment_bytes: u64,
pub logical_cache_bytes: usize,
pub vector_cache_bytes: usize,
pub phase_budget_bytes: usize,
pub query_memory_max_bytes: u64,
pub unindexed_walk_max_owners: u64,
pub lock_acquisition_timeout_ms: u64,
pub max_expanded_commit_bytes: usize,
pub planner_stats_bytes: usize,
pub planner_stats_idle_seconds: u64,
pub planner_stats_max_age_commits: u64,
pub idempotency_window_seconds: u64,
}Expand description
Initial embedded storage configuration, not a whole-process RSS promise.
Fields§
§managed_limit_bytes: usizeTotal managed byte envelope for the store.
page_cache_bytes: usizeBytes reserved for the redb page cache.
transaction_pool_bytes: usizeBytes reserved for transaction staging.
durability: DurabilityLogical durability contract applied to writes.
shard_count: usizeNumber of physical storage shards (independent redb files / writers). Default 1 preserves today’s single-file layout. A value > 1 enables the per-shard backend array; the writer currently targets shard 0 until the per-shard commit-index split (W4 phase 2) lands.
experimental_multi_shard: boolAcknowledge that shard_count > 1 is experimental. Multi-shard commit
groups are persisted as independent redb transactions per shard, so a
crash between shard commits is not atomic and can leave a torn
global commit sequence. Until a redo journal makes the group atomic,
multi-shard stores are refused unless this is set explicitly.
max_group_count: usizeMax commits coalesced into one group-commit redb write transaction (P04 bounded writer). 0 = no count cap.
max_group_bytes: usizeMax staged op-set bytes coalesced into one group (P04 bounded writer). 0 = no byte cap.
max_group_delay_ms: u64Max time the group-commit publisher lingers before flushing, giving concurrent commits a window to join one fsync (V2 WAL batching tuning). 0 = no linger (flush immediately).
log_segment_bytes: u64Target size of one segmented WAL file before it is sealed and a new segment starts (log-first). Must be at least 64 KiB.
logical_cache_bytes: usizeBytes reserved for byte-accounted logical caches (decoded records, adjacency, property dictionary). Charged to the shared budget tree so cache growth is bounded and visible to the governor. 0 = disabled.
vector_cache_bytes: usizeBytes the resident ANN generations of vector spaces may hold, a
budget of its own under the managed limit (not a share of
logical_cache_bytes), so a large space keeps its index beside the
record and text caches. 0 = no resident ANN: searches answer exactly.
phase_budget_bytes: usizeBytes reserved for concurrent request phases (query planning and
execution admission). Each ExecutionContext and each DataFusion
session reserves a fixed per-request token from this pool, so the pool
size sets the process-wide concurrency ceiling. Decoupled from
logical_cache_bytes so a small cache budget does not accidentally cap
concurrency at a handful of requests. 0 = phase admission disabled.
query_memory_max_bytes: u64Per-query working-set cap in bytes. When non-zero, a structured query
that would materialize more than this returns resource exhausted
instead of ballooning RSS (config #3). 0 = off.
unindexed_walk_max_owners: u64Largest record population a filter without a usable index may check ; a query above it is refused at planning with the index to declare. 0 = off.
lock_acquisition_timeout_ms: u64Maximum time to wait for the admission lock before failing a commit
with resource exhausted (retryable). 0 = wait indefinitely.
max_expanded_commit_bytes: usizeMax bytes of one commit’s expanded write set (encoded op-set plus the
serialized CommitBatch command payload) before the commit index is
reserved (large-transaction support). A single oversized
ingest/mutate request is rejected here, cleanly and without fencing
the store, instead of burning a commit index and only failing much
later when a 64 MiB-capped WAL record can’t hold it. Deliberately a
generous, product-level ceiling (hundreds of MB to low GB) — the
WAL’s own log_store::MAX_RECORD_BYTES stays fixed, and a commit
under this ceiling but over that one is transparently chained across
several physical records (see wal::encode_chained_ops_record).
Above this ceiling, the expectation is an external ETL/bulk-load
pipeline, not the live transactional path (matching Postgres COPY,
Neo4j’s offline bulk importer, MongoDB’s mongoimport).
planner_stats_bytes: usizeByte budget of the planner-statistics cache, a child of the logical cache budget when that is enabled. 0 = no caching (every estimate walks the value dictionary).
planner_stats_idle_seconds: u64Seconds a planner-statistics entry may sit unused before eviction.
planner_stats_max_age_commits: u64Commits after which a cached planner-statistics entry is recomputed.
idempotency_window_seconds: u64How long a retry receipt answers a repeated commit key. A retry after the window executes as a new commit.
Implementations§
Source§impl StorageResources
impl StorageResources
Sourcepub fn validate(&self) -> Result<(), ResourceError>
pub fn validate(&self) -> Result<(), ResourceError>
Validate the configuration envelope.
§Errors
Returns ResourceError::Invalid when any size is zero or out of
range, the cache and transaction pools do not fit with headroom in the
managed envelope, Memory durability is configured, or the shard count
is outside 1..=256.