garbage_collect

Function garbage_collect 

Source
pub async fn garbage_collect(
    storage: &dyn SyncStorage,
) -> Result<GcResult, SnapshotError>
Expand description

Delete changesets that are superseded by a snapshot.

Reads snapshot metadata to get per-device cursors at snapshot time. For each device, only deletes changesets with seq <= the device’s cursor in the snapshot. This ensures changesets pushed AFTER the snapshot are preserved, even if their seq is below another device’s snapshot seq.

Devices that don’t appear in the snapshot metadata are skipped entirely (they appeared after the snapshot was created).