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: usizeMaximum adjacency cache size in bytes (default: 1GB)
parallelism: usizeNumber of worker threads for parallel execution
batch_size: usizeSize of each data morsel/batch (number of rows)
max_frontier_size: usizeMaximum size of traversal frontier before pruning
auto_flush_threshold: usizeAuto-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: usizeMinimum 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: boolEnable write-ahead logging (default: true)
compaction: CompactionConfigCompaction configuration
throttle: WriteThrottleConfigWrite throttling configuration
file_sandbox: FileSandboxConfigFile sandbox configuration for BACKUP/COPY/EXPORT commands. MUST be enabled with allowed paths in server mode to prevent arbitrary file access.
query_timeout: DurationDefault query execution timeout (default: 30s)
commit_timeout: DurationMaximum 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: usizeDefault maximum memory per query (default: 1GB)
max_transaction_memory: usizeMaximum transaction buffer memory in bytes (default: 1GB). Limits memory usage during transactions to prevent OOM.
max_compaction_rows: usizeMaximum 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: boolEnable 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: usizeMaximum iterations for recursive CTE evaluation (default: 1000).
object_store: ObjectStoreConfigObject store resilience configuration
index_rebuild: IndexRebuildConfigBackground index rebuild configuration
strict_schema: boolWhen 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: boolEnable 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: boolWhen 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: usizePer-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: usizePer-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: boolWhen 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: usizeMaximum 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: DurationMaximum 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: DurationPhase 4a: how often the background TTL sweeper polls the registry for expired forks. Default: 60 seconds.
disable_fork_sweeper: boolPhase 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: u64Phase 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: DurationPhase 5a-impl Step 7: how often the background fork index builder polls active forks for build candidates. Default 30 seconds.
disable_fork_index_builder: boolPhase 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: boolEnable 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§
Auto Trait Implementations§
impl Freeze for UniConfig
impl RefUnwindSafe for UniConfig
impl Send for UniConfig
impl Sync for UniConfig
impl Unpin for UniConfig
impl UnsafeUnpin for UniConfig
impl UnwindSafe for UniConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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