Skip to main content

publish

Function publish 

Source
pub fn publish(
    root: &Path,
    signal: &str,
    node: u32,
    seq: u64,
    wal_hi: u64,
    sealed: &Sealed,
) -> Result<BlockRef>
Expand description

Atomically publish a set of tables as one block under <root>/<signal>/.

Returns the published directory.

Acking an OTLP export requires that its records are recoverable, and until crate::wal existed this call was the only thing that made them so — so the caller had to wait for it. It no longer does, provided the export is in the log: wal_hi is what records that, and it must be whatever crate::wal::Wal::watermark_for answers for the sequences in sealed — an exclusive watermark over the signal as a whole, not one past this block’s own highest sequence, because sibling shards are filling their own blocks from the same log and hold sequences below it that are not here. Pass 0 when there is no log.

Getting wal_hi too high is the dangerous direction. wal_watermarks takes the maximum over every block of the signal, so a watermark that claims sequences no block holds makes replay skip them — silent loss, with the client holding a 200. Too low only costs a re-ingest.