Skip to main content

apply_clean_entries

Function apply_clean_entries 

Source
pub fn apply_clean_entries(
    table: &mut Table,
    clean: Vec<BufferEntry>,
) -> Result<Vec<Conflict>, TableError>
Expand description

The integration point with the live database: stages every clean entry through Table’s put_from_buffer/patch_from_buffer/delete_from_buffer, in the order merge produced — never through a lower-level path that could smuggle in a historical _seq, and never through the trigger-firing put/patch/delete (the entry’s originating live write already fired them once). A TableError::Unique here means the entry was clean against other buffers but violates a unique constraint against the CURRENT registry state (which may have changed since the entry was buffered) — that also becomes a Conflict, not a silent error. Any other TableError (validation, not-found on a patch, …) is surfaced to the caller instead of being folded into a conflict, since it is not something conflict resolution can fix.