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: usizeMaximum 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: usizeMaximum application payload bytes accepted in one record.
pipeline_window_records: usizeMaximum dispatched but not yet logically committed records. Slots are replenished individually as ordered quorum completions arrive.
max_inflight_bytes: usizeMaximum 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: usizeMaximum 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: DurationMaximum 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: usizeTarget 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: usizeHard 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: DurationMaximum 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
impl Clone for WalEngineConfig
Source§fn clone(&self) -> WalEngineConfig
fn clone(&self) -> WalEngineConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WalEngineConfig
impl Debug for WalEngineConfig
Auto Trait Implementations§
impl Freeze for WalEngineConfig
impl RefUnwindSafe for WalEngineConfig
impl Send for WalEngineConfig
impl Sync for WalEngineConfig
impl Unpin for WalEngineConfig
impl UnsafeUnpin for WalEngineConfig
impl UnwindSafe for WalEngineConfig
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request