Skip to main content

UniConfig

Struct UniConfig 

Source
pub struct UniConfig {
Show 36 fields pub cache_size: usize, pub parallelism: usize, pub batch_size: usize, pub max_frontier_size: usize, pub auto_flush_threshold: usize, pub auto_flush_interval: Option<Duration>, pub auto_flush_min_mutations: usize, pub wal_enabled: bool, pub compaction: CompactionConfig, pub throttle: WriteThrottleConfig, pub file_sandbox: FileSandboxConfig, pub query_timeout: Duration, pub commit_timeout: Duration, pub max_query_memory: usize, pub max_transaction_memory: usize, pub max_compaction_rows: usize, pub enable_vid_labels_index: bool, pub max_recursive_cte_iterations: usize, pub object_store: ObjectStoreConfig, pub index_rebuild: IndexRebuildConfig, pub strict_schema: bool, pub partial_lance_writes: bool, pub defer_embeddings: bool, pub fork_fragment_warn_threshold: usize, pub tx_id_reservoir_batch: usize, pub async_flush_enabled: bool, pub max_pending_flushes: usize, pub drop_fork_drain_timeout: Duration, pub max_forks: Option<usize>, pub fork_default_ttl: Option<Duration>, pub fork_sweeper_interval: Duration, pub disable_fork_sweeper: bool, pub fork_index_build_threshold: u64, pub fork_index_builder_interval: Duration, pub disable_fork_index_builder: bool, pub ssi_enabled: bool,
}

Fields§

§cache_size: usize

Maximum adjacency cache size in bytes (default: 1GB)

§parallelism: usize

Number of worker threads for parallel execution

§batch_size: usize

Size of each data morsel/batch (number of rows)

§max_frontier_size: usize

Maximum size of traversal frontier before pruning

§auto_flush_threshold: usize

Auto-flush threshold for L0 buffer (default: 10_000 mutations)

§auto_flush_interval: Option<Duration>

Auto-flush interval for L0 buffer (default: 5 seconds). Flush triggers if time elapsed AND mutation count >= auto_flush_min_mutations. Set to None to disable time-based flush.

§auto_flush_min_mutations: usize

Minimum mutations required before the time-based flush triggers (default: 1).

Prevents unnecessary flushes when activity is minimal. Raising this (e.g., to 1000) lets small bursts coalesce into one flush — useful for benchmark workloads — but for active databases with high write rates, raising it reduces flush frequency and lets the active overlay grow larger between flushes, which can hurt read latency. Tune with compaction.frozen_segments_compact_threshold together. See issue #55 for the trade-off discussion.

§wal_enabled: bool

Enable write-ahead logging (default: true)

§compaction: CompactionConfig

Compaction configuration

§throttle: WriteThrottleConfig

Write throttling configuration

§file_sandbox: FileSandboxConfig

File sandbox configuration for BACKUP/COPY/EXPORT commands. MUST be enabled with allowed paths in server mode to prevent arbitrary file access.

§query_timeout: Duration

Default query execution timeout (default: 30s)

§commit_timeout: Duration

Maximum wall time a transaction commit may take before it is aborted with CommitTimeout (default: 5s). This guards against a commit blocking on the writer/flush lock, but it also bounds the commit’s own compute time — so workloads that commit very large transactions in a single shot (bulk-history backfills, or unoptimized debug builds) may need to raise it.

§max_query_memory: usize

Default maximum memory per query (default: 1GB)

§max_transaction_memory: usize

Maximum transaction buffer memory in bytes (default: 1GB). Limits memory usage during transactions to prevent OOM.

§max_compaction_rows: usize

Maximum rows for in-memory compaction (default: 5M, ~725MB at 145 bytes/row). Configurable OOM guard to prevent memory exhaustion during compaction.

§enable_vid_labels_index: bool

Enable in-memory VID-to-labels index for O(1) lookups (default: true). Memory cost: ~42 bytes per vertex (1M vertices ≈ 42MB).

§max_recursive_cte_iterations: usize

Maximum iterations for recursive CTE evaluation (default: 1000).

§object_store: ObjectStoreConfig

Object store resilience configuration

§index_rebuild: IndexRebuildConfig

Background index rebuild configuration

§strict_schema: bool

When true, reject writes that reference labels or edge types not declared in the schema. Default: false (schemaless mode — any label or edge type is accepted and dynamically registered).

§partial_lance_writes: bool

Enable Lance MergeInsert for SET-only flushes (default: false).

When true, Writer::insert_vertex_partial records the touched property keys into L0 and the flush emits a partial-column source to Lance via MergeInsertBuilder — skipping the read of (and write of) the unchanged columns. Wide-row schemas with vector indexes benefit most (~17 ms/row → ~3 ms/row on the issue #72 ingest workload). See the Round-11 plan section in plan-and-implement-a-valiant-flame.md.

§defer_embeddings: bool

When true, auto-embedding for vertex writes is deferred from the per-row insert_vertex_* path to the next L1 flush, where the existing process_embeddings_for_batch issues one model call for the whole flush batch instead of N per-row calls.

Trade-off: in-tx reads of the embedding column on a freshly SET/inserted vertex see the OLD storage value (or no value, for new vertices) until flush. Existing behavior is identical to today’s process_embeddings_impl(target_prop present) short-circuit (writer.rs:2727) — updating only the source text never refreshes the embedding mid-tx, deferred or not. Opt-in for workloads that don’t read embeddings between write and commit.

Default: false (preserves bit-for-bit compatibility with pre-Phase-B releases).

§fork_fragment_warn_threshold: usize

Per-fork L1 fragment-count threshold above which a tracing::warn! fires once per crossing during fork flush. Long-lived heavy-write forks accumulate fragments because fork compaction is deferred to Phase 5; this surfaces the risk operationally. Default: 256.

§tx_id_reservoir_batch: usize

Per-transaction VID/EID reservoir refill size. Each Transaction pre-reserves this many IDs at a time from the global IdAllocator, amortizing its tokio::Mutex over N allocations. Tradeoff: larger = fewer global-mutex acquisitions but more wasted IDs on short transactions (capped at batch_size - 1 per tx). u64 ID space makes the waste negligible. Default: 16.

§async_flush_enabled: bool

When true, check_flush on the commit path dispatches via the async path (flush_to_l1_async): rotate L0 under flush_lock, then spawn the streaming + finalize work on a background task. Concurrent committers no longer queue on the flush’s long I/O.

When false (default for now), check_flush calls the original synchronous flush_to_l1 and holds flush_lock across the full L1-streaming write. This is the kill-switch.

§max_pending_flushes: usize

Maximum number of L0→L1 flushes that may be in-flight simultaneously when async_flush_enabled is true. The (N+1)th rotate blocks until one of the in-flight flushes finalizes. Bounds WAL retention and memory growth. Default: 2.

§drop_fork_drain_timeout: Duration

Maximum time drop_fork will wait for pending async flushes on that fork before failing with PendingFlushTimeout. Only meaningful when async_flush_enabled is true. Default: 10s.

§max_forks: Option<usize>

Phase 4a: cap on total fork count (Active + Pending + Tombstoned). None = unbounded. When set, Session::fork(name).await errors with UniError::ForkBudgetExceeded once the cap is reached. Tombstoned forks count because they still hold branch state on disk until recovery completes; counting them prevents churn-thrash.

§fork_default_ttl: Option<Duration>

Phase 4a: default TTL applied to forks when the user does not supply one via session.fork(name).ttl(...). None = no TTL. The background sweeper drops forks whose ttl_expires_at is in the past via drop_fork_cascade.

§fork_sweeper_interval: Duration

Phase 4a: how often the background TTL sweeper polls the registry for expired forks. Default: 60 seconds.

§disable_fork_sweeper: bool

Phase 4a: skip spawning the TTL sweeper. Tests should set this to true when they want deterministic control over fork lifetimes; production should leave it false.

§fork_index_build_threshold: u64

Phase 5a: minimum per-fork row count (per label) before the background IndexRebuildManager schedules a fork-local index build. Below this threshold, fork reads inherit primary’s indexes through Lance base_paths; above it, the planner switches to FusedIndexScan once the build completes. Default 10,000 rows per spec §8.

§fork_index_builder_interval: Duration

Phase 5a-impl Step 7: how often the background fork index builder polls active forks for build candidates. Default 30 seconds.

§disable_fork_index_builder: bool

Phase 5a-impl Step 7: skip spawning the background fork index builder. Tests that exercise the manual Session::build_fork_local_index trigger should set this to true so timing isn’t dependent on the polling cadence.

§ssi_enabled: bool

Enable Serializable Snapshot Isolation and optimistic concurrency control (default: true).

When true, read-write transactions read from a pinned L0 snapshot, track an item-level read/write-set, and validate at commit under flush_lock: a write-write or read-write conflict against a commit landed since the transaction’s snapshot aborts with UniError::SerializationConflict, a duplicate concurrent MERGE on a unique key aborts with UniError::ConstraintConflict, and FOR UPDATE acquires per-key row locks. Callers should wrap contended writes in Session::transact_with_retry, which re-runs retriable conflicts.

When false, the engine reverts to last-writer-wins: concurrent read-modify-write transactions can silently lose updates, concurrent MERGE can create duplicate unique keys, and FOR UPDATE is a no-op (a tracing::warn! is emitted when a query requests it). Reads run against the live L0 with no snapshot pinning. This reproduces the pre-SSI behavior bit-for-bit and skips the (near-zero, but non-nil) read-set/validation overhead — appropriate only for single-writer workloads or callers that guard read-modify-write externally.

Defaults to true because silent lost updates are a correctness hazard for any concurrent-writer workload.

Trait Implementations§

Source§

impl Clone for UniConfig

Source§

fn clone(&self) -> UniConfig

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 Debug for UniConfig

Source§

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

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

impl Default for UniConfig

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more