Skip to main content

reset

Function reset 

Source
pub async fn reset(store: &dyn Store, prefix: &KeyPrefix) -> Result<ResetReport>
Expand description

Tombstone every live record under prefix. prefix.namespace is required. Resetting every namespace in a store is not a reset, so a caller who wants that must loop over namespaces explicitly.

For each live key (consumer list), reads its current revision and issues delete(key, Some(revision)). A key that disappears between list and get is skipped. A Conflict goes into ResetReport::conflicts.

Stops at the first store error and returns it; keys already tombstoned stay tombstoned, so a re-run is safe. Against a daemon whose backing store predates tombstones, deletes are physical and do not replicate (spec ยง8.1).