Skip to main content

commit_edit_paths

Function commit_edit_paths 

Source
pub async fn commit_edit_paths<E>(
    store: &dyn ObjectStore,
    cfg: &LeanConfig,
    flush: &str,
    first: Option<Option<Arc<LoadedManifest>>>,
    edit: impl Fn(Option<&LoadedManifest>, &mut DocEdit<'_>) -> Result<(), E>,
) -> EditOutcome<E>
Expand description

commit_edit_from without copying the document (latency plan §16): the edit writes an overlay (DocEdit); the commit re-chunks only from the first chunk an overlay path falls in until the chunking lines up again (chunk::rechunk_with), answers the retire set from the overlay and the chunks’ aliases (docview::retired_over), and publishes only the chunks that changed. The document it installs is the one commit_edit_from would; the shadow check (LeanConfig::g_shadow, and every debug build) asserts the same chunk list, chunk bytes and retire set. A document that is not chunked, or none, is edited whole as before, and so is every document under chunk_view = false.