pub struct StreamConfig<'a> {
pub base_snapshot_key: &'a str,
pub page_size: usize,
pub backpressure: BackpressureConfig,
pub rpo_target: Option<Duration>,
pub epoch: u64,
pub owner: Option<&'a str>,
pub pointer_generation: u64,
}Expand description
Configuration for a streaming session.
Fields§
§base_snapshot_key: &'a strObject-store key of the base tier-1a snapshot the frames replay onto. Recorded in every generation manifest; restore re-fetches it.
page_size: usizePage size of the base snapshot — read it from the snapshot header
(offset 16, u16 big-endian; the on-disk value 1 means 65 536).
Required because the seam does not return it and sync_server.rs’s
4 KB hardcode is the wrong default to inherit.
backpressure: BackpressureConfigR574-F2: bounded spill buffer + overflow policy + 429/503 backoff
for the R2 upload side of the drain loop. Default is
behavior-preserving (BackpressurePolicy::Fail — errors bubble
immediately, same as before this field existed).
rpo_target: Option<Duration>R574-T4: the stated RPO bound — the caller’s own scheduler is
expected to invoke tail_frames often enough that the watermark
never goes stale past this. None (the default) means no target is
asserted; RpoStatus::breached is always false in that case,
but RpoStatus::watermark_age is still reported so a caller can
observe the real gap before picking a number.
R761-T1: DEFAULT_RPO_TARGET (120 s, tailed at
DEFAULT_TAIL_INTERVAL = 60 s) is the number to put here absent a
reason to pick another — its doc carries the measured write-op table
that justifies it. None stays the default so that a caller who has
not thought about RPO never gets a breach flag it did not ask for.
epoch: u64R732-F2 (W245): this writer’s fencing token — the per-tenant epoch
handed out by yubaba’s raft state machine
(YubabaState::tenant_fencing_token). It is stamped into every frame
key, every generation manifest, and the watermark sidecar, and it is
checked before a single frame is uploaded: a writer whose epoch is
lower than the one already recorded at the sink is a stale owner and
bounces with StreamOutcome::Fenced rather than interleaving its
frames with the real owner’s.
0 means unfenced, and is the behaviour-preserving default for a
single-writer deployment that has no ownership authority to ask. Note
that unfenced is not exempt: a 0 writer is still fenced by any sink
already stamped with a real epoch, which is exactly what should happen
when a tenant has been claimed and a legacy streamer is still running.
owner: Option<&'a str>R732-F2: opaque label for who holds epoch — a yubaba node id, a
hostname, whatever the caller finds useful. Recorded in the manifest
and never interpreted here. Purely diagnostic: when you are staring at
a fenced stream at 3am, “which owner wrote generation 7” is the first
question, and the epoch alone does not answer it.
pointer_generation: u64R736-T2 (W250): the cross-cell fence — this writer’s belief about
the global tenant→cell pointer’s generation
(yah_tenant_pointer::PointerRecord::generation). epoch alone
fences within one raft group; it says nothing when ownership moves
to a different cell, because the two cells run independent raft
groups that share no epoch counter. Checked alongside epoch before
any frame is uploaded: a writer whose generation is lower than the
one already recorded at the sink is a stale cell and bounces with
StreamOutcome::Fenced, exactly like a stale epoch.
0 means unfenced — the same behaviour-preserving default as
epoch, for a single-cell deployment that has no global pointer to
ask. This mirrors yah_tenant_pointer’s FIRST_GENERATION = 1: 0
is what an unfenced writer defaults to and must never be mistakable
for a live cross-cell owner. The caller (yubaba’s control plane)
resolves the pointer and hands the generation in as a plain u64 —
this crate does not link yah_tenant_pointer to read it itself.
Auto Trait Implementations§
impl<'a> Freeze for StreamConfig<'a>
impl<'a> RefUnwindSafe for StreamConfig<'a>
impl<'a> Send for StreamConfig<'a>
impl<'a> Sync for StreamConfig<'a>
impl<'a> Unpin for StreamConfig<'a>
impl<'a> UnsafeUnpin for StreamConfig<'a>
impl<'a> UnwindSafe for StreamConfig<'a>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for T
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