Skip to main content

WalEngineConfig

Struct WalEngineConfig 

Source
pub struct WalEngineConfig {
    pub queue_capacity: usize,
    pub max_record_bytes: usize,
    pub pipeline_window_records: usize,
    pub max_inflight_bytes: usize,
    pub max_replica_lag_bytes: usize,
    pub lane_stall_timeout: Duration,
    pub max_segment_bytes: usize,
    pub max_active_segment_bytes: usize,
    pub repair_interval: Option<Duration>,
    pub shutdown_timeout: Duration,
}
Expand description

Capacity controls for the in-process transactional WAL pipeline.

Fields§

§queue_capacity: usize

Maximum records waiting to enter the dispatched pipeline.

This is one combined bound across the handle-to-engine channel and the engine’s internal queue, not a separate allowance for each stage. The default is 256 records, eight times the default pipeline window.

§max_record_bytes: usize

Maximum application payload bytes accepted in one record.

§pipeline_window_records: usize

Maximum dispatched but not yet logically committed records. Slots are replenished individually as ordered quorum completions arrive.

§max_inflight_bytes: usize

Maximum encoded WAL bytes admitted but not yet resolved through the ordered quorum completion stream. Admission waits for this byte budget before taking ownership of another record.

§max_replica_lag_bytes: usize

Maximum unacknowledged encoded bytes retained for one replica lane. A lane that falls farther behind is dropped so a healthy quorum can continue without retaining an unbounded retry suffix. Must be at least max_inflight_bytes.

§lane_stall_timeout: Duration

Maximum interval in which a lane with retained writes may make no durable-tail progress before it is shed.

Any increase in persisted_size resets the interval, so a slow but steadily advancing lane remains live. Shedding never changes the strict-majority quorum requirement: if the remaining lanes cannot cover an admitted record, the writer poisons instead of advancing its commit watermark. The default is five seconds.

§max_segment_bytes: usize

Target encoded size for automatic segment rotation.

The engine checks this threshold between records, so a segment may exceed it by one complete encoded record. This is not a hard object-size limit.

Treat this as the minimum segment-size floor for the single-pending design. With sustained encoded throughput T bytes/s and worst-case provision-plus-fold latency L seconds, choose at least T * L times an operational safety factor. If the active pending segment crosses this threshold before its refill is registered, dispatch pauses fail-closed rather than acknowledging an unregistered successor.

§max_active_segment_bytes: usize

Hard encoded-byte ceiling for one active segment object.

The default is 4 GiB, deliberately far below GCS’s 5 TiB object limit. Rotation normally occurs at max_segment_bytes, but the manifest’s bounded sealed-segment directory can defer that rotation until truncation removes retained entries. Admission stops cleanly at this ceiling with Error::ActiveSegmentFull instead of letting the active object grow toward the provider limit or poisoning the healthy writer. The ceiling must fit one maximum encoded record and be at least the advisory rotation target.

§repair_interval: Option<Duration>

Interval between background maintenance passes.

Each startup and periodic pass runs the dead-incarnation sweep deferred by recovery, retries deletion tombstones below the committed floor, then repairs retained sealed segments. None disables periodic passes. Startup cleanup and repair, plus targeted repair after a degraded rotation, still run without timers.

§shutdown_timeout: Duration

Maximum time graceful shutdown may spend draining accepted work and joining owned background tasks before aborting them.

The default is five minutes, long enough for the default storage retry budget while still turning a wedged backend or task into a bounded error.

Trait Implementations§

Source§

impl Clone for WalEngineConfig

Source§

fn clone(&self) -> WalEngineConfig

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 WalEngineConfig

Source§

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

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

impl Default for WalEngineConfig

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> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
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> 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<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