Skip to main content

StorageResources

Struct StorageResources 

Source
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: usize

Total managed byte envelope for the store.

§page_cache_bytes: usize

Bytes reserved for the redb page cache.

§transaction_pool_bytes: usize

Bytes reserved for transaction staging.

§durability: Durability

Logical durability contract applied to writes.

§shard_count: usize

Number 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: bool

Acknowledge 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: usize

Max commits coalesced into one group-commit redb write transaction (P04 bounded writer). 0 = no count cap.

§max_group_bytes: usize

Max staged op-set bytes coalesced into one group (P04 bounded writer). 0 = no byte cap.

§max_group_delay_ms: u64

Max 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: u64

Target 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: usize

Bytes 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: usize

Bytes 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: usize

Bytes 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: u64

Per-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: u64

Largest 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: u64

Maximum time to wait for the admission lock before failing a commit with resource exhausted (retryable). 0 = wait indefinitely.

§max_expanded_commit_bytes: usize

Max 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: usize

Byte 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: u64

Seconds a planner-statistics entry may sit unused before eviction.

§planner_stats_max_age_commits: u64

Commits after which a cached planner-statistics entry is recomputed.

§idempotency_window_seconds: u64

How long a retry receipt answers a repeated commit key. A retry after the window executes as a new commit.

Implementations§

Source§

impl StorageResources

Source

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.

Trait Implementations§

Source§

impl Clone for StorageResources

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for StorageResources

Source§

impl Debug for StorageResources

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StorageResources

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.