Skip to main content

answer

Function answer 

Source
fn answer<B: SignalBuilder>(
    builder: &B,
    asked: &mut Vec<Sender<Option<Arc<Open>>>>,
    snapped: &mut Option<usize>,
    pending: bool,
    slot: &Shard,
    node: u32,
    seq: u64,
)
Expand description

Answer every reader waiting on the open block, if there is nothing left queued ahead of them (section 4).

pending is the correctness condition, not an optimisation: a reader is promised everything acknowledged before it asked, and an acknowledged export is in the channel or in carry until the flusher appends it. Answering with either non-empty would be answering early. Nothing is lost by waiting — non-empty means the loop is about to turn again anyway.

The snapshot itself is best-effort. One that fails to build is a query that misses the newest rows for a moment; failing the flush over it would turn a read-path nicety into an ingest outage, and the same error is about to be reported properly by the real seal.