Skip to main content

reverse_rollback_entry

Function reverse_rollback_entry 

Source
pub fn reverse_rollback_entry(
    conn: &Connection,
    entry: &RollbackEntry,
) -> Result<bool>
Expand description

Reverse a single rollback-log entry. Returns true if a reverse action was applied, false if the entry was already superseded (idempotent rollback).

Collision safety (#300 item 2): before re-inserting a snapshot we check whether another memory now owns the same (title, namespace) key. If it does, we refuse to overwrite — db::insert is an UPSERT on that key and would silently replace the unrelated memory’s content. We return an error so the operator can resolve the conflict manually (delete the offender or rename one of them) rather than clobbering user data.