Skip to main content

spawn_global_transcripts_truncate_loop

Function spawn_global_transcripts_truncate_loop 

Source
pub fn spawn_global_transcripts_truncate_loop(
    token: CancellationToken,
    store: Option<Arc<FileStore>>,
)
Expand description

Looking after the shared transcript store.

  • Its WAL is cut back by one srv on the machine, the owner of filestore.db.owner ([TruncateOwner]): a first look two minutes after start, then every half hour. The PASSIVE checkpoints (filestore/checkpointer.rs) keep the WAL’s content copied back; this gives the disk back and starts the log afresh. The TRUNCATE runs on its own connection, so this srv’s appends don’t wait behind it.
  • Its finished transcripts are compressed (transcript::framer) by every srv whose own agent:transcriptframes is on, owner or not: settings are per channel, so the owner’s alone can’t speak for the machine. Each frame is written in one transaction that checks its parts first, so two srvs framing at once never conflict; the later one finds the parts framed. A pass of at most [framer::PASS_FRAMES] frames each minute, or every few seconds while there is work.