pub struct Config {
pub data_dir: PathBuf,
pub node: u32,
pub target_block_bytes: usize,
pub max_block_age: Duration,
pub retention: Duration,
pub queue: usize,
pub shards: usize,
pub wal: Option<Arc<Wal>>,
}Expand description
Engine configuration.
Note what is not reachable from config.rs: target_block_bytes and
max_block_age are derived constants, not settings. They are the two numbers
an operator would most expect to tune and the two the engine is best placed
to own, so principle 2c applies and there is no YAML key for either.
Fields§
§data_dir: PathBuf§node: u32Writer identity, from mira_core::block::node_id. Makes block names
unique across replicas with no coordination.
target_block_bytes: usizeSeal a block once it reaches roughly this many bytes.
max_block_age: DurationSeal a block after this long regardless of size, so acknowledgement latency is bounded by time and not by the caller’s traffic.
retention: Duration§queue: usizeHow many exports may wait for one signal’s flusher. See
crate::config::Config::queue, which is where the reasoning is.
Split across shards, so the number an operator sets is
still the number of decoded exports this signal can be holding.
shards: usizeHow many flusher tasks one signal runs, each with its own channel, open block and block sequence.
One per core, not one per resource hash — section 4’s “A note on sharding” is explicit about which of those is the right unit, and the reason is that resource cardinality in real fleets is bimodal, so a hash gives a permanently hot shard and a small-file explosion in the tail. Files per flush interval should be a function of core count, known at startup, not of the customer’s topology.
One, not available_parallelism, by default: main resolves the real
number from ingest.shards and the core count, and everything that
builds a Config by hand — every unit test, every e2e node — wants the
deterministic one block per seal that a single shard gives.
wal: Option<Arc<Wal>>The write-ahead log, shared by all three signals, or None to
acknowledge on the block publish as Mira always has.
One Option rather than a separate durability setting, because the two
are the same decision: with a log, an export is recoverable the moment
it is framed and there is nothing left for the acknowledgement to wait
for; without one, the publish is the only thing that makes it
recoverable. A flag that let those disagree would only be able to
express wrong answers.
Off by default. Turning it on would trade read-your-writes away — see
mira_core::wal’s module docs — were it not for
mira_core::query::search_open, which scans the flusher’s open builder
alongside the sealed blocks and buys it back.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
impl<T> Allocation for T
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].