Skip to main content

repair_journal_file

Function repair_journal_file 

Source
pub fn repair_journal_file<T: LinkReference>(
    path: &Path,
    copies: &[&Path],
    options: &EngineOptions,
) -> Result<JournalRepair, LinkError>
Expand description

Rebuild the journal at path from the longest valid prefix among it and copies (see recover_journal). The original bytes are first copied to <path>.damaged-<n>; the replacement is flushed, then renamed over path. Holds the writer lock that FileTransitionLog::open_exclusive takes, so it fails while an engine owns the journal. Copies are only read; their owners must not be writing them.