You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CRITICAL: Race condition in concurrent writes corrupts usearch vector index #543
Concurrent writes to the usearch vector index cause data corruption. When 5 memories are written in parallel (xargs -P5), the vector index becomes out-of-sync with the SQLite database — 4 vectors are lost from the index while all 5 records exist in SQLite.
Environment
Uteke version: 0.6.1 (binary from GitHub Releases)
OS: Linux 6.8.0-1054-oracle (Oracle Cloud ARM)
Store path: ~/.uteke (local CLI)
Reproducibility: Consistent — reproducible on demand
Steps to Reproduce
# Create test namespace
uteke namespace create ctest
# Write 5 memories in parallelecho -e "mem1\nmem2\nmem3\nmem4\nmem5"| xargs -P5 -I{} bash -c 'uteke remember --namespace ctest "concurrent test {}"'# Verify consistency
uteke doctor
uteke verify
Expected Behavior
All 5 vectors should appear in both SQLite and usearch index. Index should be thread-safe or queue writes sequentially.
Actual Behavior
SQLite contains all 5 records
usearch index only contains 1-4 vectors (4 lost in our test)
uteke doctor reports: DB=19339, Index=19335 (mismatch)
Error logged: rename temp to final key mapping: No such file or directory
Running uteke repair recovers consistency by rebuilding index from SQLite
Impact
Data loss risk: Memories exist in DB but are invisible to semantic recall
Silent failure: No error returned to caller — write appears successful
Production blocker: Multi-agent coordination (multiple agents writing simultaneously) will trigger this
Suggested Fix
Add a write lock (RwLock or Mutex) around vector index operations
Or implement a write queue that serializes index modifications
Consider using usearch native thread-safety options if available
Interim: add auto-repair after batch writes
Workaround
Run uteke repair after any batch or concurrent write operations.
Activity
fix: add cross-process file lock to prevent usearch race condition (#543
Merge pull request #556 from codecoradev/fix/543-usearch-race-condition
fix: use buffer-based serialization to bypass usearch C++ file I/O on…
sync: develop → main (v0.7.3 release) (#651)
release: v0.7.3 — develop → main (proper sync) (#653)
fix: add cross-process file lock to prevent usearch race condition (#543
Merge pull request #556 from codecoradev/fix/543-usearch-race-condition
fix: use buffer-based serialization to bypass usearch C++ file I/O on…