Export publish does not fsync the export directory, so a power loss can drop the latest Forgets from the export #93
Labels
No labels
boundary:crosses
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:go
svd:hold
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/messages-mind-mcp#93
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
export_tombstones(src/messages_mind_mcp/tombstones.py:179-210) publishes the export withos.replace(tmp, dest)(:199) and then commitsexport_pending = 0in the Tombstone store (:200-201). Nothing callsfsyncon the export directory after the rename, and nothing callsfsyncon the temp file before it.Failure
export_pending.dest, and commitsexport_pending = 0. SQLite syncs that commit to the Tombstone store.destis the previous export. It is complete and valid, but it lacks the Forget from step 1.export_pendingis 0, so no pass writes the export again.ADR 0006 treats Tombstones as the erasure guard, so this is a Forget-durability gap.
Fix direction
fsyncthe temp file beforeos.replace, andfsyncthe export directory after it, beforeexport_pendingis cleared.fsyncmust leaveexport_pendingset, so the next pass writes the export again.os.fsyncand on the directory open, in the order file, rename, directory, commit. Linux CI runs Python 3.12 onpython:3.12-slim-bookworm.restore_tombstones,os.linkattombstones.py:284) needs the same directoryfsync.Out of scope
#92 states this limit in SECURITY only, because it has no
src/edit.Filed under: #92 architect gate (spec note 20), from the PR #91 security review.