Skip to content

MutateGate: batch rollback does not undo rename_id on failure #27

Closed

Description

@chouswei

Summary

When a Tier A / MutateGate batch fails mid-commit, the except MemNetError path restores deleted rows, reverts added ids, and puts back replaced snapshots — but it does not reverse successful rename_id operations that ran earlier in the same batch.

Evidence

  • parts/common/memnet/memnet/mutate_gate.py: rollback block restores deleted_backup, added, and replaced only (approx. lines 355–368).
  • Rename loop calls self.ss.store.rename_id(...) before mark_written(); a later failure leaves the store partially re-keyed while the caller sees a rejected batch.

Impact

Agents may retry against stale ids; graph integrity can diverge from ack expectations on multi-step update batches mixing patch, drop, and id= rename lines.

Suggested direction

Track rename pairs applied in the batch and invert them on rollback (or defer renames until end of batch with a single commit point).

Note

Unrelated to v0.3.6 serve hardening (3c537c7); still open on current master.

Activity

  1. added a commit that references this issue on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions