Context
Tracked from issue #3 review as deferred item.
Current behavior
Per-client archives under memvid/per-client/{client}/ are updated by scripts (save-session.sh, register-tool.sh, etc.) with non-atomic file writes. If a write is interrupted (crash, signal, disk full), the archive can be left in a partial state:
- Manifest WAL updated but data files not written
- Data files written but manifest not updated
- Multiple concurrent writers to same client directory = last-write-wins on manifests
Why it matters
- Corrupted client archive = permanent data loss or broken search
- No recovery path except re-ingest from sources
- Debugging requires manual inspection of WAL vs data state
- Multi-tenant use case breaks under concurrent load
Expected behavior
All write paths to per-client archives should be atomic:
- Write new data to temp file
- Fsync temp file
- Atomic rename to final path (POSIX
rename() is atomic on same filesystem)
- Update manifest WAL via the same pattern
- Acquire
.lock at client-level before any multi-file write
Acceptance criteria
Priority
High for production multi-client use. Medium for current single-user workload.
Related
Context
Tracked from issue #3 review as deferred item.
Current behavior
Per-client archives under
memvid/per-client/{client}/are updated by scripts (save-session.sh,register-tool.sh, etc.) with non-atomic file writes. If a write is interrupted (crash, signal, disk full), the archive can be left in a partial state:Why it matters
Expected behavior
All write paths to per-client archives should be atomic:
rename()is atomic on same filesystem).lockat client-level before any multi-file writeAcceptance criteria
bridge.py,save-session.sh,register-tool.sh, any script touchingmemvid/.lockfile check before writesmemvid/README.mdPriority
High for production multi-client use. Medium for current single-user workload.
Related