Repository navigation
fix(vmshared): snapshot delete is dual-state idempotent (clears libvirt metadata when the registry entry is absent) - #204
Conversation
…rt metadata when the registry entry is absent) Measured gap (RCA #8): removing a golden disk and registry entry leaves the libvirt snapshot metadata, so charly vm destroy fails ("cannot delete inactive domain with 1 snapshots") and recapture fails ("domain already exists"). DeleteSnapshot now best-effort invokes the libvirt cleanup even when the entry is absent, succeeds idempotently once the state is clean, and surfaces a real libvirt failure. Three new unit tests (absent-entry cleanup, libvirt-failure surfacing, present-entry regression).
Review — BLOCKHead SHA: Change class: code change (sdk Blocks
Non-blocking notes
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — BLOCKHead SHA: Change class: code change (sdk Blocks
Comment intake
Non-blocking notes
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — PASSHead SHA: Security screen: PASS — no scope mismatch, no secrets/exfiltration, no weakened guardrails, no supply-chain changes. Single atomic commit. Checklist: All applicable rules PASS or NA. Prior Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
Summary
Fix the measured dual-state snapshot-delete dead end (RCA #8): a missing registry entry while the LIBVIRT snapshot metadata remains blocked
charly vm destroyand re-provisioning.DeleteSnapshotnow performs the libvirt-side cleanup EVEN when the registry entry is absent, succeeds idempotently once every state is clean, and surfaces a real libvirt failure.How tested
Unit (real output):
LIVE proof (fresh-rebuild binary 2026.247.1634; named disposable target
check-snap-probe,disposable: true): the delete completed in 0.157 s against the absent-entry state (the fix's branch — the registry had no entry, the libvirt metadata was cleaned, the FS cleanup continued):Fresh-rebuild confirmation: the delete ran against a fresh-rebuild binary (2026.247.1634) on the named disposable target; the golden lifecycle was also exercised across the keepers fleet (all four channel goldens re-captured and durable).
Rulebook: R1 (measured gap, mechanism fix); R3 (one canonical dual-state delete); R4 (no workaround); R7 genuinely-pasted proofs; B17 (named disposable target). Tier: fully tested and validated.
Assisted-by: pi ollama-cloud/deepseek-v4-flash:0731 (fully tested and validated)